Skip to content

Commit

Permalink
Add support for pytest --tb
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
johannes-mueller committed Jun 1, 2024
1 parent f701b14 commit ad7d4f0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test-cockpit-python.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"--cov-report"
"-r"
"--log-level"
"--tb"
"--disable-warnings"
"--capture=no"
"-k"
Expand Down Expand Up @@ -140,6 +141,15 @@
:choices '("debug" "info" "warn" "error")
:description "log level")

(transient-define-infix test-cockpit-python--choose-traceback ()
:class 'transient-switches
:key "-t"
:argument-format "--tb=%s"
:argument-regexp "--tb=\\(long\\|short\\|line\\|native\\|no\\)"
:choices '("long" "short" "line" "native" "no")
:description "show traceback style")


(defun test-cockpit-python--infix ()
"Setup the pytest specific test switches."
[["Switches"
Expand All @@ -157,7 +167,8 @@
("-r" "report output of passed tests" "-rFP")
("-w" "don't output warnings" "--disable-warnings")
("-n" "don't capture output" "--capture=no")
("-L" "show locals in tracebacks" "--showlocals")]])
("-L" "show locals in tracebacks" "--showlocals")
(test-cockpit-python--choose-traceback)]])

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

0 comments on commit ad7d4f0

Please sign in to comment.