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

Method test_reportinfo

testing/test_doctest.py:781–795  ·  view source on GitHub ↗

Make sure that DoctestItem.reportinfo() returns lineno.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

779 result.stdout.fnmatch_lines(["* 1 passed *"])
780
781 def test_reportinfo(self, pytester: Pytester):
782 """Make sure that DoctestItem.reportinfo() returns lineno."""
783 p = pytester.makepyfile(
784 test_reportinfo="""
785 def foo(x):
786 '''
787 >>> foo('a')
788 'b'
789 '''
790 return 'c'
791 """
792 )
793 items, reprec = pytester.inline_genitems(p, "--doctest-modules")
794 reportinfo = items[0].reportinfo()
795 assert reportinfo[1] == 1
796
797 def test_valid_setup_py(self, pytester: Pytester):
798 """

Callers

nothing calls this directly

Calls 3

makepyfileMethod · 0.45
inline_genitemsMethod · 0.45
reportinfoMethod · 0.45

Tested by

no test coverage detected