Skip to content

Commit 0824789

Browse files
committed
Improve test for pytest.exit handling
1 parent d35d09f commit 0824789

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

testing/test_unittest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,11 +1078,11 @@ def test_exit_outcome(testdir):
10781078
10791079
class MyTestCase(unittest.TestCase):
10801080
def test_exit_outcome(self):
1081-
pytest.exit("pytest_exit")
1081+
pytest.exit("pytest_exit called")
10821082
10831083
def test_should_not_run(self):
10841084
pass
10851085
"""
10861086
)
1087-
reprec = testdir.inline_run()
1088-
reprec.assertoutcome()
1087+
result = testdir.runpytest()
1088+
result.stdout.fnmatch_lines("*Exit: pytest_exit called*")

0 commit comments

Comments
 (0)