Skip to content

Commit 26fe593

Browse files
Add support for pytest -x
Fixes #28
1 parent 22466aa commit 26fe593

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test-cockpit-python.el

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"--capture=no"
6161
"-k"
6262
"-m"
63-
"--mypy"))
63+
"--mypy"
64+
"--exitfirst"))
6465

6566
(defun test-cockpit-python--test-project-command (_ args)
6667
"Make the test project command from ARGS."
@@ -143,6 +144,7 @@
143144
[["Switches"
144145
("-k" test-cockpit-python--restrict-substring)
145146
("-f" "only lastly failed tests" "--last-failed")
147+
("-x" "exit after first fail" "--exitfirst")
146148
("-b" "build extensions before testing" "build_ext")
147149
("-m" test-cockpit-python--marker-switch)
148150
("-M" "test type hints" "--mypy")]

test/test-python.el-test.el

+4-3
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,10 @@ async def test_first_outer():
393393
(should (equal (aref (aref infix 0) 0) "Switches"))
394394
(should (equal (car (aref (aref infix 0) 1)) "-k"))
395395
(should (equal (aref (aref infix 0) 2) '("-f" "only lastly failed tests" "--last-failed")))
396-
(should (equal (aref (aref infix 0) 3) '("-b" "build extensions before testing" "build_ext")))
397-
(should (equal (car (aref (aref infix 0) 4)) "-m"))
398-
(should (equal (aref (aref infix 0) 5) '("-M" "test type hints" "--mypy")))
396+
(should (equal (aref (aref infix 0) 3) '("-x" "exit after first fail" "--exitfirst")))
397+
(should (equal (aref (aref infix 0) 4) '("-b" "build extensions before testing" "build_ext")))
398+
(should (equal (car (aref (aref infix 0) 5)) "-m"))
399+
(should (equal (aref (aref infix 0) 6) '("-M" "test type hints" "--mypy")))
399400
(should (equal (aref (aref infix 1) 0) "Output"))
400401
(should (equal (aref (aref infix 1) 1) '("-v" "show single tests" "--verbose")))
401402
(should (equal (aref (aref infix 1) 2) '("-V" "verbose output" "-vv")))

0 commit comments

Comments
 (0)