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"
(interactive)
(let ((venv-dir (find-venv)))
(if venv-dir
(when venv-dir
(progn
(pyvenv-activate venv-dir)
(lsp))
(pyvenv-deactivate))))
(lsp)))))
(defun symbols-at-point ()
(let* ((lsp--document-symbols-request-async t)
@ -191,11 +190,13 @@
(filename (f-no-ext (f-filename (buffer-file-name)))))
(string-join (append path (list filename) (python-test-at-point)) ".")))
(defun python-run-test-at-point ()
(interactive)
(defun python-run-test-at-point (debug)
(interactive "P")
(let ((python (executable-find "python"))
(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
:bind (:map python-mode-map