terminal: summary_passes: handle teardown sections
Fixes https://github.com/pytest-dev/pytest/issues/2780.
This commit is contained in:
@@ -790,8 +790,15 @@ def test_pass_reporting_on_fail(testdir):
|
||||
def test_pass_output_reporting(testdir):
|
||||
testdir.makepyfile(
|
||||
"""
|
||||
def setup_module():
|
||||
print("setup_module")
|
||||
|
||||
def teardown_module():
|
||||
print("teardown_module")
|
||||
|
||||
def test_pass_has_output():
|
||||
print("Four score and seven years ago...")
|
||||
|
||||
def test_pass_no_output():
|
||||
pass
|
||||
"""
|
||||
@@ -806,8 +813,12 @@ def test_pass_output_reporting(testdir):
|
||||
[
|
||||
"*= PASSES =*",
|
||||
"*_ test_pass_has_output _*",
|
||||
"*- Captured stdout setup -*",
|
||||
"setup_module",
|
||||
"*- Captured stdout call -*",
|
||||
"Four score and seven years ago...",
|
||||
"*- Captured stdout teardown -*",
|
||||
"teardown_module",
|
||||
"*= short test summary info =*",
|
||||
"PASSED test_pass_output_reporting.py::test_pass_has_output",
|
||||
"PASSED test_pass_output_reporting.py::test_pass_no_output",
|
||||
|
||||
Reference in New Issue
Block a user