diff --git a/README.rst b/README.rst index 7633326..40df884 100644 --- a/README.rst +++ b/README.rst @@ -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 `_) + * add a ``python-pytest-directories`` command with interactive multi-directory selection - (`#21 `_) - (`#31 `_) + (`#21 `_, + `#31 `_) 2.0.0 (2020-08-04) ------------------ * switch to ``transient`` (``magit-popup`` replacement); the command for the menu is now ``python-pytest-dispatch`` - (`#18 `_) - (`#26 `_) + (`#18 `_, + `#26 `_) * add ``python-pytest-files`` command with interactive multi-file selection diff --git a/python-pytest.el b/python-pytest.el index 31fb466..1b8ef25 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -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) @@ -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"))