Skip to content

Commit b64d940

Browse files
authored
Merge pull request #5108 from blueyed/summary
terminal summary: display passes after warnings
2 parents 24bd51b + ea79eb5 commit b64d940

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

changelog/5108.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The short test summary is displayed after passes with output (``-rP``).

src/_pytest/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,9 @@ def pytest_terminal_summary(self):
684684
self.summary_errors()
685685
self.summary_failures()
686686
self.summary_warnings()
687+
self.summary_passes()
687688
yield
688689
self.short_test_summary()
689-
self.summary_passes()
690690
# Display any extra warnings from teardown here (if any).
691691
self.summary_warnings()
692692

testing/test_terminal.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,11 +769,19 @@ def test_pass_no_output():
769769
assert "test_pass_has_output" not in s
770770
assert "Four score and seven years ago..." not in s
771771
assert "test_pass_no_output" not in s
772-
result = testdir.runpytest("-rP")
772+
result = testdir.runpytest("-rPp")
773773
result.stdout.fnmatch_lines(
774-
["*test_pass_has_output*", "Four score and seven years ago..."]
774+
[
775+
"*= PASSES =*",
776+
"*_ test_pass_has_output _*",
777+
"*- Captured stdout call -*",
778+
"Four score and seven years ago...",
779+
"*= short test summary info =*",
780+
"PASSED test_pass_output_reporting.py::test_pass_has_output",
781+
"PASSED test_pass_output_reporting.py::test_pass_no_output",
782+
"*= 2 passed in *",
783+
]
775784
)
776-
assert "test_pass_no_output" not in result.stdout.str()
777785

778786

779787
def test_color_yes(testdir):

0 commit comments

Comments
 (0)