Skip to content

Commit ad7d4f0

Browse files
Add support for pytest --tb
Fixes #30
1 parent f701b14 commit ad7d4f0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test-cockpit-python.el

+12-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"--cov-report"
5757
"-r"
5858
"--log-level"
59+
"--tb"
5960
"--disable-warnings"
6061
"--capture=no"
6162
"-k"
@@ -140,6 +141,15 @@
140141
:choices '("debug" "info" "warn" "error")
141142
:description "log level")
142143

144+
(transient-define-infix test-cockpit-python--choose-traceback ()
145+
:class 'transient-switches
146+
:key "-t"
147+
:argument-format "--tb=%s"
148+
:argument-regexp "--tb=\\(long\\|short\\|line\\|native\\|no\\)"
149+
:choices '("long" "short" "line" "native" "no")
150+
:description "show traceback style")
151+
152+
143153
(defun test-cockpit-python--infix ()
144154
"Setup the pytest specific test switches."
145155
[["Switches"
@@ -157,7 +167,8 @@
157167
("-r" "report output of passed tests" "-rFP")
158168
("-w" "don't output warnings" "--disable-warnings")
159169
("-n" "don't capture output" "--capture=no")
160-
("-L" "show locals in tracebacks" "--showlocals")]])
170+
("-L" "show locals in tracebacks" "--showlocals")
171+
(test-cockpit-python--choose-traceback)]])
161172

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

0 commit comments

Comments
 (0)