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

Method test_doctest_id

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

Source from the content-addressed store, hash-verified

808 reprec.assertoutcome(passed=1)
809
810 def test_doctest_id(self, pytester: Pytester) -> None:
811 pytester.makefile(
812 ".txt",
813 """
814 >>> x=3
815 >>> x
816 4
817 """,
818 )
819 testid = "test_doctest_id.txt::test_doctest_id.txt"
820 expected_lines = [
821 "*= FAILURES =*",
822 "*_ ?doctest? test_doctest_id.txt _*",
823 "FAILED test_doctest_id.txt::test_doctest_id.txt",
824 "*= 1 failed in*",
825 ]
826 result = pytester.runpytest(testid, "-rf", "--tb=short")
827 result.stdout.fnmatch_lines(expected_lines)
828
829 # Ensure that re-running it will still handle it as
830 # doctest.DocTestFailure, which was not the case before when
831 # re-importing doctest, but not creating a new RUNNER_CLASS.
832 result = pytester.runpytest(testid, "-rf", "--tb=short")
833 result.stdout.fnmatch_lines(expected_lines)
834
835 def test_core_backward_compatibility(self) -> None:
836 """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