Skip to content

Commit 5747bbe

Browse files
Merge branch 'master' into dape-support
2 parents 0ab5d44 + ad7d4f0 commit 5747bbe

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

test-cockpit-python.el

+17-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@
7070
"--cov-report"
7171
"-r"
7272
"--log-level"
73+
"--tb"
7374
"--disable-warnings"
7475
"--capture=no"
7576
"-k"
7677
"-m"
77-
"--mypy"))
78+
"--mypy"
79+
"--exitfirst"
80+
"--showlocals"))
7881

7982
(defun test-cockpit-python--test-project-command (_ args)
8083
"Make the test project command from ARGS."
@@ -152,11 +155,21 @@
152155
:choices '("debug" "info" "warn" "error")
153156
:description "log level")
154157

158+
(transient-define-infix test-cockpit-python--choose-traceback ()
159+
:class 'transient-switches
160+
:key "-t"
161+
:argument-format "--tb=%s"
162+
:argument-regexp "--tb=\\(long\\|short\\|line\\|native\\|no\\)"
163+
:choices '("long" "short" "line" "native" "no")
164+
:description "show traceback style")
165+
166+
155167
(defun test-cockpit-python--infix ()
156168
"Setup the pytest specific test switches."
157169
[["Switches"
158170
("-k" test-cockpit-python--restrict-substring)
159171
("-f" "only lastly failed tests" "--last-failed")
172+
("-x" "exit after first fail" "--exitfirst")
160173
("-b" "build extensions before testing" "build_ext")
161174
("-m" test-cockpit-python--marker-switch)
162175
("-M" "test type hints" "--mypy")]
@@ -167,7 +180,9 @@
167180
("-c" "print coverage report" "--cov-report=term-missing")
168181
("-r" "report output of passed tests" "-rFP")
169182
("-w" "don't output warnings" "--disable-warnings")
170-
("-n" "don't capture output" "--capture=no")]])
183+
("-n" "don't capture output" "--capture=no")
184+
("-L" "show locals in tracebacks" "--showlocals")
185+
(test-cockpit-python--choose-traceback)]])
171186

172187
(defun test-cockpit-python--find-last-unindented-line ()
173188
"Find the last unindented line from current point in current buffer."

test/test-python.el-test.el

+6-4
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,15 @@ async def test_first_outer():
445445
(should (equal (aref (aref infix 0) 0) "Switches"))
446446
(should (equal (car (aref (aref infix 0) 1)) "-k"))
447447
(should (equal (aref (aref infix 0) 2) '("-f" "only lastly failed tests" "--last-failed")))
448-
(should (equal (aref (aref infix 0) 3) '("-b" "build extensions before testing" "build_ext")))
449-
(should (equal (car (aref (aref infix 0) 4)) "-m"))
450-
(should (equal (aref (aref infix 0) 5) '("-M" "test type hints" "--mypy")))
448+
(should (equal (aref (aref infix 0) 3) '("-x" "exit after first fail" "--exitfirst")))
449+
(should (equal (aref (aref infix 0) 4) '("-b" "build extensions before testing" "build_ext")))
450+
(should (equal (car (aref (aref infix 0) 5)) "-m"))
451+
(should (equal (aref (aref infix 0) 6) '("-M" "test type hints" "--mypy")))
451452
(should (equal (aref (aref infix 1) 0) "Output"))
452453
(should (equal (aref (aref infix 1) 1) '("-v" "show single tests" "--verbose")))
453454
(should (equal (aref (aref infix 1) 2) '("-V" "verbose output" "-vv")))
454455
(should (equal (aref (aref infix 1) 4) '("-c" "print coverage report" "--cov-report=term-missing")))
455456
(should (equal (aref (aref infix 1) 5) '("-r" "report output of passed tests" "-rFP")))
456457
(should (equal (aref (aref infix 1) 6) '("-w" "don't output warnings" "--disable-warnings")))
457-
(should (equal (aref (aref infix 1) 7) '("-n" "don't capture output" "--capture=no"))))))
458+
(should (equal (aref (aref infix 1) 7) '("-n" "don't capture output" "--capture=no")))
459+
(should (equal (aref (aref infix 1) 8) '("-L" "show locals in tracebacks" "--showlocals"))))))

0 commit comments

Comments
 (0)