Skip to content

Commit

Permalink
Add support for pytest -x
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
johannes-mueller committed Jun 1, 2024
1 parent 22466aa commit 26fe593
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test-cockpit-python.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"--capture=no"
"-k"
"-m"
"--mypy"))
"--mypy"
"--exitfirst"))

(defun test-cockpit-python--test-project-command (_ args)
"Make the test project command from ARGS."
Expand Down Expand Up @@ -143,6 +144,7 @@
[["Switches"
("-k" test-cockpit-python--restrict-substring)
("-f" "only lastly failed tests" "--last-failed")
("-x" "exit after first fail" "--exitfirst")
("-b" "build extensions before testing" "build_ext")
("-m" test-cockpit-python--marker-switch)
("-M" "test type hints" "--mypy")]
Expand Down
7 changes: 4 additions & 3 deletions test/test-python.el-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,10 @@ async def test_first_outer():
(should (equal (aref (aref infix 0) 0) "Switches"))
(should (equal (car (aref (aref infix 0) 1)) "-k"))
(should (equal (aref (aref infix 0) 2) '("-f" "only lastly failed tests" "--last-failed")))
(should (equal (aref (aref infix 0) 3) '("-b" "build extensions before testing" "build_ext")))
(should (equal (car (aref (aref infix 0) 4)) "-m"))
(should (equal (aref (aref infix 0) 5) '("-M" "test type hints" "--mypy")))
(should (equal (aref (aref infix 0) 3) '("-x" "exit after first fail" "--exitfirst")))
(should (equal (aref (aref infix 0) 4) '("-b" "build extensions before testing" "build_ext")))
(should (equal (car (aref (aref infix 0) 5)) "-m"))
(should (equal (aref (aref infix 0) 6) '("-M" "test type hints" "--mypy")))
(should (equal (aref (aref infix 1) 0) "Output"))
(should (equal (aref (aref infix 1) 1) '("-v" "show single tests" "--verbose")))
(should (equal (aref (aref infix 1) 2) '("-V" "verbose output" "-vv")))
Expand Down

0 comments on commit 26fe593

Please sign in to comment.