Skip to content

Commit

Permalink
Merge branch 'master' into dape-support
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-mueller committed Jun 1, 2024
2 parents 0ab5d44 + ad7d4f0 commit 5747bbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
19 changes: 17 additions & 2 deletions test-cockpit-python.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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")]
Expand All @@ -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."
Expand Down
10 changes: 6 additions & 4 deletions test/test-python.el-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))))))

0 comments on commit 5747bbe

Please sign in to comment.