MCPcopy
hub / github.com/pytest-dev/pytest / test_with_failing_collection

Method test_with_failing_collection

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

Source from the content-addressed store, hash-verified

1022 result.stdout.fnmatch_lines(["*durations*", "*call*test_3*"])
1023
1024 def test_with_failing_collection(self, pytester: Pytester, mock_timing) -> None:
1025 pytester.makepyfile(self.source)
1026 pytester.makepyfile(test_collecterror="""xyz""")
1027 result = pytester.runpytest_inprocess("--durations=2", "-k test_1")
1028 assert result.ret == 2
1029
1030 result.stdout.fnmatch_lines(["*Interrupted: 1 error during collection*"])
1031 # Collection errors abort test execution, therefore no duration is
1032 # output
1033 result.stdout.no_fnmatch_line("*duration*")
1034
1035 def test_with_not(self, pytester: Pytester, mock_timing) -> None:
1036 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