Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions python-pytest.el
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ With a prefix ARG, allow editing."
"Major mode for pytest sessions (derived from comint-mode)."
(compilation-setup))

(defvar python-pytest-finished-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map compilation-minor-mode-map)
(define-key map [remap recompile] #'python-pytest-repeat)
map)
"Keymap for `python-pytest-mode' major mode.")

(cl-defun python-pytest--run (&key args file func edit)
"Run pytest for the given arguments."
(setq args (python-pytest--transform-arguments args))
Expand Down Expand Up @@ -413,6 +420,9 @@ With a prefix ARG, allow editing."
(defun python-pytest--process-sentinel (proc _state)
"Process sentinel helper to run hooks after PROC finishes."
(with-current-buffer (process-buffer proc)
(compilation-mode)
(read-only-mode -1) ;; required for python-pytest-repeat
(use-local-map python-pytest-finished-mode-map)
(run-hooks 'python-pytest-finished-hook)))

(defun python-pytest--transform-arguments (args)
Expand Down