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

Method test_with_failing_collection

testing/acceptance_test.py:918–927  ·  view source on GitHub ↗
(self, pytester: Pytester, mock_timing)

Source from the content-addressed store, hash-verified

916 result.stdout.fnmatch_lines(["*durations*", "*call*test_3*"])
917
918 def test_with_failing_collection(self, pytester: Pytester, mock_timing) -> None:
919 pytester.makepyfile(self.source)
920 pytester.makepyfile(test_collecterror="""xyz""")
921 result = pytester.runpytest_inprocess("--durations=2", "-k test_1")
922 assert result.ret == 2
923
924 result.stdout.fnmatch_lines(["*Interrupted: 1 error during collection*"])
925 # Collection errors abort test execution, therefore no duration is
926 # output
927 result.stdout.no_fnmatch_line("*duration*")
928
929 def test_with_not(self, pytester: Pytester, mock_timing) -> None:
930 pytester.makepyfile(self.source)

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytest_inprocessMethod · 0.45

Tested by

no test coverage detected