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

Method test_valid_setup_py

testing/test_doctest.py:797–813  ·  view source on GitHub ↗

Test to make sure that pytest ignores valid setup.py files when ran with --doctest-modules

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

795 assert reportinfo[1] == 1
796
797 def test_valid_setup_py(self, pytester: Pytester):
798 """
799 Test to make sure that pytest ignores valid setup.py files when ran
800 with --doctest-modules
801 """
802 p = pytester.makepyfile(
803 setup="""
804 from setuptools import setup, find_packages
805 setup(name='sample',
806 version='0.0',
807 description='description',
808 packages=find_packages()
809 )
810 """
811 )
812 result = pytester.runpytest(p, "--doctest-modules")
813 result.stdout.fnmatch_lines(["*collected 0 items*"])
814
815 def test_main_py_does_not_cause_import_errors(self, pytester: Pytester):
816 p = pytester.copy_example("doctest/main_py")

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected