Improve test for pytest.exit handling

This commit is contained in:
Bruno Oliveira 2019-07-23 08:52:52 -03:00
parent d35d09f82d
commit 0824789459
1 changed files with 3 additions and 3 deletions

View File

@ -1078,11 +1078,11 @@ def test_exit_outcome(testdir):
class MyTestCase(unittest.TestCase):
def test_exit_outcome(self):
pytest.exit("pytest_exit")
pytest.exit("pytest_exit called")
def test_should_not_run(self):
pass
"""
)
reprec = testdir.inline_run()
reprec.assertoutcome()
result = testdir.runpytest()
result.stdout.fnmatch_lines("*Exit: pytest_exit called*")