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

Method test_doctest_linedata_missing

testing/test_doctest.py:320–337  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

318 )
319
320 def test_doctest_linedata_missing(self, pytester: Pytester):
321 pytester.path.joinpath("hello.py").write_text(
322 textwrap.dedent(
323 """\
324 class Fun(object):
325 @property
326 def test(self):
327 '''
328 >>> a = 1
329 >>> 1/0
330 '''
331 """
332 )
333 )
334 result = pytester.runpytest("--doctest-modules")
335 result.stdout.fnmatch_lines(
336 ["*hello*", "006*>>> 1/0*", "*UNEXPECTED*ZeroDivision*", "*1 failed*"]
337 )
338
339 def test_doctest_linedata_on_property(self, pytester: Pytester):
340 pytester.makepyfile(

Callers

nothing calls this directly

Calls 2

fnmatch_linesMethod · 0.80
runpytestMethod · 0.45

Tested by

no test coverage detected