Use C-u to run tests in debug mode

This commit is contained in:
Ohad Livne 2025-06-04 22:44:58 +03:00
parent 4304c91381
commit 8bd5477de0
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -162,11 +162,10 @@
"Set up the Python IDE in the current project" "Set up the Python IDE in the current project"
(interactive) (interactive)
(let ((venv-dir (find-venv))) (let ((venv-dir (find-venv)))
(if venv-dir (when venv-dir
(progn (progn
(pyvenv-activate venv-dir) (pyvenv-activate venv-dir)
(lsp)) (lsp)))))
(pyvenv-deactivate))))
(defun symbols-at-point () (defun symbols-at-point ()
(let* ((lsp--document-symbols-request-async t) (let* ((lsp--document-symbols-request-async t)
@ -191,11 +190,13 @@
(filename (f-no-ext (f-filename (buffer-file-name))))) (filename (f-no-ext (f-filename (buffer-file-name)))))
(string-join (append path (list filename) (python-test-at-point)) "."))) (string-join (append path (list filename) (python-test-at-point)) ".")))
(defun python-run-test-at-point () (defun python-run-test-at-point (debug)
(interactive) (interactive "P")
(let ((python (executable-find "python")) (let ((python (executable-find "python"))
(test-name (python-test-name-at-point))) (test-name (python-test-name-at-point)))
(compile (concat python " -m unittest " test-name)))) (if debug
(pdb (concat python " -m pdb -m unittest " test-name))
(compile (concat python " -m unittest " test-name)))))
(use-package python (use-package python
:bind (:map python-mode-map :bind (:map python-mode-map