Skip to content

Redesign dispatch menu #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,26 @@ __ https://stable.melpa.org/
3.0.0 (not yet released)
------------------------

* redesign the menu:
use better groupings,
use multi-column visual layout,
add some more flags,
make all flags start with either ``-`` or ``--``
(mostly mimicking pytest flags)
(`#28 <https://github.com/wbolster/emacs-python-pytest/pull/28>`_)

* add a ``python-pytest-directories`` command with interactive
multi-directory selection
(`#21 <https://github.com/wbolster/emacs-python-pytest/issues/21>`_)
(`#31 <https://github.com/wbolster/emacs-python-pytest/pull/31>`_)
(`#21 <https://github.com/wbolster/emacs-python-pytest/issues/21>`_,
`#31 <https://github.com/wbolster/emacs-python-pytest/pull/31>`_)

2.0.0 (2020-08-04)
------------------

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

* add ``python-pytest-files`` command with interactive multi-file
selection
Expand Down
63 changes: 34 additions & 29 deletions python-pytest.el
Original file line number Diff line number Diff line change
Expand Up @@ -120,35 +120,40 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
(define-transient-command python-pytest-dispatch ()
"Show popup for running pytest."
:man-page "pytest"
:incompatible '(("--exitfirst" "--maxfail="))
:value '("--color")
["Switches"
("-c" "color" "--color")
("-d" "run doctests" "--doctest-modules")
("-f" "failed first" "--failed-first")
("-l" "show locals" "--showlocals")
("-p" "debug on error" "--pdb")
("-q" "quiet" "--quiet")
("-s" "do not capture output" "--capture=no")
("-t" "do not cut tracebacks" "--full-trace")
(python-pytest:-v)
("-x" "exit after first failure" "--exitfirst")]
["Options"
("=k" "only names matching expression" "-k=")
("=m" "only marks matching expression" "-m=")
(python-pytest:--tb)
("=x" "exit after N failures or errors" "--maxfail=")]
[["Run tests"
("t" "Test all" python-pytest)
("r" "Repeat last test run" python-pytest-repeat)
("x" "Test last-failed" python-pytest-last-failed)]
["Run tests for specific files"
("f" "Test file (dwim)" python-pytest-file-dwim)
("F" "Test this file" python-pytest-file)
("m" "Test multiple files" python-pytest-files)
("m" "Test multiple directories" python-pytest-directories)]
["Run tests for current function/class"
("d" "Test def/class (dwim)" python-pytest-function-dwim)
("D" "Test this def/class" python-pytest-function)]])
["Output"
[("-c" "color" "--color")
("-q" "quiet" "--quiet")
("-s" "no output capture" "--capture=no")
(python-pytest:-v)]]
["Selection, filtering, ordering"
[("-k" "only names matching expression" "-k=")
("-m" "only marks matching expression" "-m=")
" "] ;; visual alignment
[("--dm" "run doctests" "--doctest-modules")
("--nf" "new first" "--new-first")
("--sw" "stepwise" "--stepwise")]]
["Failures, errors, debugging"
[("-l" "show locals" "--showlocals")
("-p" "debug on error" "--pdb")
("-x" "exit after first failure" "--exitfirst")]
[("--ff" "failed first" "--failed-first")
("--ft" "full tracebacks" "--full-trace")
("--mf" "exit after N failures or errors" "--maxfail=")
("--rx" "run xfail tests" "--runxfail")
(python-pytest:--tb)
("--tr" "debug on each test" "--trace")]]
["Run tests"
[("t" "all" python-pytest)]
[("r" "repeat" python-pytest-repeat)
("x" "last failed" python-pytest-last-failed)]
[("f" "file (dwim)" python-pytest-file-dwim)
("F" "file (this)" python-pytest-file)]
[("m" "files" python-pytest-files)
("M" "directories" python-pytest-directories)]
[("d" "def/class (dwim)" python-pytest-function-dwim)
("D" "def/class (this)" python-pytest-function)]])

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

Expand Down Expand Up @@ -446,7 +451,7 @@ When present ON-REPLACEMENT is substituted, else OFF-REPLACEMENT is appended."
(transient-define-argument python-pytest:--tb ()
:description "traceback style"
:class 'transient-option
:key "=t"
:key "--tb"
:argument "--tb="
:choices '("long" "short" "line" "native" "no"))

Expand Down