diff --git a/test-cockpit-python.el b/test-cockpit-python.el index 46e9eb6..509ce32 100644 --- a/test-cockpit-python.el +++ b/test-cockpit-python.el @@ -70,11 +70,14 @@ "--cov-report" "-r" "--log-level" + "--tb" "--disable-warnings" "--capture=no" "-k" "-m" - "--mypy")) + "--mypy" + "--exitfirst" + "--showlocals")) (defun test-cockpit-python--test-project-command (_ args) "Make the test project command from ARGS." @@ -152,11 +155,21 @@ :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" ("-k" test-cockpit-python--restrict-substring) ("-f" "only lastly failed tests" "--last-failed") + ("-x" "exit after first fail" "--exitfirst") ("-b" "build extensions before testing" "build_ext") ("-m" test-cockpit-python--marker-switch) ("-M" "test type hints" "--mypy")] @@ -167,7 +180,9 @@ ("-c" "print coverage report" "--cov-report=term-missing") ("-r" "report output of passed tests" "-rFP") ("-w" "don't output warnings" "--disable-warnings") - ("-n" "don't capture output" "--capture=no")]]) + ("-n" "don't capture output" "--capture=no") + ("-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." diff --git a/test/test-python.el-test.el b/test/test-python.el-test.el index 76e5de4..2863b94 100644 --- a/test/test-python.el-test.el +++ b/test/test-python.el-test.el @@ -445,13 +445,15 @@ async def test_first_outer(): (should (equal (aref (aref infix 0) 0) "Switches")) (should (equal (car (aref (aref infix 0) 1)) "-k")) (should (equal (aref (aref infix 0) 2) '("-f" "only lastly failed tests" "--last-failed"))) - (should (equal (aref (aref infix 0) 3) '("-b" "build extensions before testing" "build_ext"))) - (should (equal (car (aref (aref infix 0) 4)) "-m")) - (should (equal (aref (aref infix 0) 5) '("-M" "test type hints" "--mypy"))) + (should (equal (aref (aref infix 0) 3) '("-x" "exit after first fail" "--exitfirst"))) + (should (equal (aref (aref infix 0) 4) '("-b" "build extensions before testing" "build_ext"))) + (should (equal (car (aref (aref infix 0) 5)) "-m")) + (should (equal (aref (aref infix 0) 6) '("-M" "test type hints" "--mypy"))) (should (equal (aref (aref infix 1) 0) "Output")) (should (equal (aref (aref infix 1) 1) '("-v" "show single tests" "--verbose"))) (should (equal (aref (aref infix 1) 2) '("-V" "verbose output" "-vv"))) (should (equal (aref (aref infix 1) 4) '("-c" "print coverage report" "--cov-report=term-missing"))) (should (equal (aref (aref infix 1) 5) '("-r" "report output of passed tests" "-rFP"))) (should (equal (aref (aref infix 1) 6) '("-w" "don't output warnings" "--disable-warnings"))) - (should (equal (aref (aref infix 1) 7) '("-n" "don't capture output" "--capture=no")))))) + (should (equal (aref (aref infix 1) 7) '("-n" "don't capture output" "--capture=no"))) + (should (equal (aref (aref infix 1) 8) '("-L" "show locals in tracebacks" "--showlocals"))))))