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

Method test_doctest_id

testing/acceptance_test.py:902–925  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

900 reprec.assertoutcome(passed=1)
901
902 def test_doctest_id(self, pytester: Pytester) -> None:
903 pytester.makefile(
904 ".txt",
905 """
906 >>> x=3
907 >>> x
908 4
909 """,
910 )
911 testid = "test_doctest_id.txt::test_doctest_id.txt"
912 expected_lines = [
913 "*= FAILURES =*",
914 "*_ ?doctest? test_doctest_id.txt _*",
915 "FAILED test_doctest_id.txt::test_doctest_id.txt",
916 "*= 1 failed in*",
917 ]
918 result = pytester.runpytest(testid, "-rf", "--tb=short")
919 result.stdout.fnmatch_lines(expected_lines)
920
921 # Ensure that re-running it will still handle it as
922 # doctest.DocTestFailure, which was not the case before when
923 # re-importing doctest, but not creating a new RUNNER_CLASS.
924 result = pytester.runpytest(testid, "-rf", "--tb=short")
925 result.stdout.fnmatch_lines(expected_lines)
926
927 def test_core_backward_compatibility(self) -> None:
928 """Test backward compatibility for get_plugin_manager function. See #787."""

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makefileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected