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): class MyTestCase(unittest.TestCase):
def test_exit_outcome(self): def test_exit_outcome(self):
pytest.exit("pytest_exit") pytest.exit("pytest_exit called")
def test_should_not_run(self): def test_should_not_run(self):
pass pass
""" """
) )
reprec = testdir.inline_run() result = testdir.runpytest()
reprec.assertoutcome() result.stdout.fnmatch_lines("*Exit: pytest_exit called*")