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

Method test_doctestmodule_three_tests

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

Source from the content-addressed store, hash-verified

551 reprec.assertoutcome(passed=1)
552
553 def test_doctestmodule_three_tests(self, pytester: Pytester):
554 p = pytester.makepyfile(
555 """
556 '''
557 >>> p = getfixture('tmp_path')
558 >>> p.is_dir()
559 True
560 '''
561 def my_func():
562 '''
563 >>> magic = 42
564 >>> magic - 42
565 0
566 '''
567 def useless():
568 pass
569 def another():
570 '''
571 >>> import os
572 >>> os is os
573 True
574 '''
575 """
576 )
577 reprec = pytester.inline_run(p, "--doctest-modules")
578 reprec.assertoutcome(passed=3)
579
580 def test_doctestmodule_two_tests_one_fail(self, pytester: Pytester):
581 p = pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected