Skip to content

Commit 0c8d591

Browse files
committed
wip: redesign dispatch menu
1 parent 88850ab commit 0c8d591

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

python-pytest.el

+33-26
Original file line numberDiff line numberDiff line change
@@ -120,34 +120,41 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
120120
(define-transient-command python-pytest-dispatch ()
121121
"Show popup for running pytest."
122122
:man-page "pytest"
123+
:incompatible '(("--exitfirst" "--maxfail="))
123124
:value '("--color")
124-
["Switches"
125-
("-c" "color" "--color")
126-
("-d" "run doctests" "--doctest-modules")
127-
("-f" "failed first" "--failed-first")
128-
("-l" "show locals" "--showlocals")
125+
["Output"
126+
[("-c" "color" "--color")
127+
("-q" "quiet" "--quiet")
128+
(python-pytest:-v)
129+
("-l" "show locals" "--showlocals")
130+
("-s" "no output capture" "--capture=no")]
131+
[("--ft" "full tracebacks" "--full-trace")
132+
(python-pytest:--tb)]]
133+
["Test selection"
134+
[("--dm" "run doctests" "--doctest-modules")
135+
("-k" "only names matching expression" "-k=")
136+
("-m" "only marks matching expression" "-m=")]
137+
[("--ff" "failed first" "--failed-first")
138+
("--nf" "new first" "--new-first")
139+
("--sw" "stepwise" "--stepwise")
140+
("--rx" "run xfail tests" "--runxfail")]]
141+
["Exit early"
142+
("-x" "exit after first failure" "--exitfirst")
143+
("--mf" "exit after N failures or errors" "--maxfail=")]
144+
["Debugger"
129145
("-p" "debug on error" "--pdb")
130-
("-q" "quiet" "--quiet")
131-
("-s" "do not capture output" "--capture=no")
132-
("-t" "do not cut tracebacks" "--full-trace")
133-
(python-pytest:-v)
134-
("-x" "exit after first failure" "--exitfirst")]
135-
["Options"
136-
("=k" "only names matching expression" "-k=")
137-
("=m" "only marks matching expression" "-m=")
138-
(python-pytest:--tb)
139-
("=x" "exit after N failures or errors" "--maxfail=")]
146+
("--tr" "debug on each test" "--trace")]
140147
[["Run tests"
141-
("t" "Test all" python-pytest)
142-
("r" "Repeat last test run" python-pytest-repeat)
143-
("x" "Test last-failed" python-pytest-last-failed)]
144-
["Run tests for specific files"
145-
("f" "Test file (dwim)" python-pytest-file-dwim)
146-
("F" "Test this file" python-pytest-file)
147-
("m" "Test multiple files" python-pytest-files)]
148-
["Run tests for current function/class"
149-
("d" "Test def/class (dwim)" python-pytest-function-dwim)
150-
("D" "Test this def/class" python-pytest-function)]])
148+
("t" "Test" python-pytest)
149+
("r" "Repeat" python-pytest-repeat)
150+
("x" "Last failed" python-pytest-last-failed)]
151+
[""
152+
("f" "File (dwim)" python-pytest-file-dwim)
153+
("F" "This file" python-pytest-file)
154+
("m" "Multiple files" python-pytest-files)]
155+
[""
156+
("d" "def/class (dwim)" python-pytest-function-dwim)
157+
("D" "This def/class" python-pytest-function)]])
151158

152159
(define-obsolete-function-alias 'python-pytest-popup 'python-pytest-dispatch)
153160

@@ -435,7 +442,7 @@ When present ON-REPLACEMENT is substituted, else OFF-REPLACEMENT is appended."
435442
(transient-define-argument python-pytest:--tb ()
436443
:description "traceback style"
437444
:class 'transient-option
438-
:key "=t"
445+
:key "--tb"
439446
:argument "--tb="
440447
:choices '("long" "short" "line" "native" "no"))
441448

0 commit comments

Comments
 (0)