Skip to content

Commit e2ff7e1

Browse files
committed
Redesign dispatch menu
* use better groupings * use multi-column visual layout * add some more flags * make all flags start with either ``-`` or ``--`` (mostly mimicking pytest flags)
1 parent 9ca8c94 commit e2ff7e1

File tree

2 files changed

+46
-33
lines changed

2 files changed

+46
-33
lines changed

README.rst

+12-4
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,26 @@ __ https://stable.melpa.org/
379379
3.0.0 (not yet released)
380380
------------------------
381381

382+
* redesign the menu:
383+
use better groupings,
384+
use multi-column visual layout,
385+
add some more flags,
386+
make all flags start with either ``-`` or ``--``
387+
(mostly mimicking pytest flags)
388+
(`#28 <https://github.com/wbolster/emacs-python-pytest/pull/28>`_)
389+
382390
* add a ``python-pytest-directories`` command with interactive
383391
multi-directory selection
384-
(`#21 <https://github.com/wbolster/emacs-python-pytest/issues/21>`_)
385-
(`#31 <https://github.com/wbolster/emacs-python-pytest/pull/31>`_)
392+
(`#21 <https://github.com/wbolster/emacs-python-pytest/issues/21>`_,
393+
`#31 <https://github.com/wbolster/emacs-python-pytest/pull/31>`_)
386394

387395
2.0.0 (2020-08-04)
388396
------------------
389397

390398
* switch to ``transient`` (``magit-popup`` replacement);
391399
the command for the menu is now ``python-pytest-dispatch``
392-
(`#18 <https://github.com/wbolster/emacs-python-pytest/issues/18>`_)
393-
(`#26 <https://github.com/wbolster/emacs-python-pytest/pull/26>`_)
400+
(`#18 <https://github.com/wbolster/emacs-python-pytest/issues/18>`_,
401+
`#26 <https://github.com/wbolster/emacs-python-pytest/pull/26>`_)
394402

395403
* add ``python-pytest-files`` command with interactive multi-file
396404
selection

python-pytest.el

+34-29
Original file line numberDiff line numberDiff line change
@@ -120,35 +120,40 @@ 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")
129-
("-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=")]
140-
[["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-
("m" "Test multiple directories" python-pytest-directories)]
149-
["Run tests for current function/class"
150-
("d" "Test def/class (dwim)" python-pytest-function-dwim)
151-
("D" "Test this def/class" python-pytest-function)]])
125+
["Output"
126+
[("-c" "color" "--color")
127+
("-q" "quiet" "--quiet")
128+
("-s" "no output capture" "--capture=no")
129+
(python-pytest:-v)]]
130+
["Selection, filtering, ordering"
131+
[("-k" "only names matching expression" "-k=")
132+
("-m" "only marks matching expression" "-m=")
133+
" "] ;; visual alignment
134+
[("--dm" "run doctests" "--doctest-modules")
135+
("--nf" "new first" "--new-first")
136+
("--sw" "stepwise" "--stepwise")]]
137+
["Failures, errors, debugging"
138+
[("-l" "show locals" "--showlocals")
139+
("-p" "debug on error" "--pdb")
140+
("-x" "exit after first failure" "--exitfirst")]
141+
[("--ff" "failed first" "--failed-first")
142+
("--ft" "full tracebacks" "--full-trace")
143+
("--mf" "exit after N failures or errors" "--maxfail=")
144+
("--rx" "run xfail tests" "--runxfail")
145+
(python-pytest:--tb)
146+
("--tr" "debug on each test" "--trace")]]
147+
["Run tests"
148+
[("t" "all" python-pytest)]
149+
[("r" "repeat" python-pytest-repeat)
150+
("x" "last failed" python-pytest-last-failed)]
151+
[("f" "file (dwim)" python-pytest-file-dwim)
152+
("f" "this file" python-pytest-file)]
153+
[("m" "files" python-pytest-files)
154+
("m" "directories" python-pytest-directories)]
155+
[("d" "def/class (dwim)" python-pytest-function-dwim)
156+
("d" "this def/class" python-pytest-function)]])
152157

153158
(define-obsolete-function-alias 'python-pytest-popup 'python-pytest-dispatch)
154159

@@ -453,7 +458,7 @@ When present ON-REPLACEMENT is substituted, else OFF-REPLACEMENT is appended."
453458
(transient-define-argument python-pytest:--tb ()
454459
:description "traceback style"
455460
:class 'transient-option
456-
:key "=t"
461+
:key "--tb"
457462
:argument "--tb="
458463
:choices '("long" "short" "line" "native" "no"))
459464

0 commit comments

Comments
 (0)