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

Method test_reportinfo

testing/test_doctest.py:862–876  ·  view source on GitHub ↗

Make sure that DoctestItem.reportinfo() returns lineno.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

860 result.stdout.fnmatch_lines(["* 1 passed *"])
861
862 def test_reportinfo(self, pytester: Pytester):
863 """Make sure that DoctestItem.reportinfo() returns lineno."""
864 p = pytester.makepyfile(
865 test_reportinfo="""
866 def foo(x):
867 '''
868 >>> foo('a')
869 'b'
870 '''
871 return 'c'
872 """
873 )
874 items, _reprec = pytester.inline_genitems(p, "--doctest-modules")
875 reportinfo = items[0].reportinfo()
876 assert reportinfo[1] == 1
877
878 def test_valid_setup_py(self, pytester: Pytester):
879 """

Callers

nothing calls this directly

Calls 3

makepyfileMethod · 0.45
inline_genitemsMethod · 0.45
reportinfoMethod · 0.45

Tested by

no test coverage detected