MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_exit_outcome

Function test_exit_outcome

testing/test_unittest.py:1161–1176  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1159
1160
1161def test_exit_outcome(pytester: Pytester) -> None:
1162 pytester.makepyfile(
1163 test_foo="""
1164 import pytest
1165 import unittest
1166
1167 class MyTestCase(unittest.TestCase):
1168 def test_exit_outcome(self):
1169 pytest.exit("pytest_exit called")
1170
1171 def test_should_not_run(self):
1172 pass
1173 """
1174 )
1175 result = pytester.runpytest()
1176 result.stdout.fnmatch_lines(["*Exit: pytest_exit called*", "*= no tests ran in *"])
1177
1178
1179def test_trace(pytester: Pytester, monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected