Merge pull request #5108 from blueyed/summary

terminal summary: display passes after warnings
This commit is contained in:
Bruno Oliveira 2019-04-15 14:49:01 -03:00 committed by GitHub
commit b64d9402ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1 @@
The short test summary is displayed after passes with output (``-rP``).

View File

@ -684,9 +684,9 @@ class TerminalReporter(object):
self.summary_errors()
self.summary_failures()
self.summary_warnings()
self.summary_passes()
yield
self.short_test_summary()
self.summary_passes()
# Display any extra warnings from teardown here (if any).
self.summary_warnings()

View File

@ -769,11 +769,19 @@ def test_pass_output_reporting(testdir):
assert "test_pass_has_output" not in s
assert "Four score and seven years ago..." not in s
assert "test_pass_no_output" not in s
result = testdir.runpytest("-rP")
result = testdir.runpytest("-rPp")
result.stdout.fnmatch_lines(
["*test_pass_has_output*", "Four score and seven years ago..."]
[
"*= PASSES =*",
"*_ test_pass_has_output _*",
"*- Captured stdout call -*",
"Four score and seven years ago...",
"*= short test summary info =*",
"PASSED test_pass_output_reporting.py::test_pass_has_output",
"PASSED test_pass_output_reporting.py::test_pass_no_output",
"*= 2 passed in *",
]
)
assert "test_pass_no_output" not in result.stdout.str()
def test_color_yes(testdir):