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

Method test_invalid_setup_py

testing/test_doctest.py:820–832  ·  view source on GitHub ↗

Test to make sure that pytest reads setup.py files that are not used for python packages when ran with --doctest-modules

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

818 result.stdout.fnmatch_lines(["*collected 2 items*", "*1 failed, 1 passed*"])
819
820 def test_invalid_setup_py(self, pytester: Pytester):
821 """
822 Test to make sure that pytest reads setup.py files that are not used
823 for python packages when ran with --doctest-modules
824 """
825 p = pytester.makepyfile(
826 setup="""
827 def test_foo():
828 return 'bar'
829 """
830 )
831 result = pytester.runpytest(p, "--doctest-modules")
832 result.stdout.fnmatch_lines(["*collected 1 item*"])
833
834
835class TestLiterals:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected