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

Method test_header

testing/test_terminal.py:842–869  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

840 result.stdout.no_fnmatch_line("plugins: *")
841
842 def test_header(self, pytester: Pytester) -> None:
843 pytester.path.joinpath("tests").mkdir()
844 pytester.path.joinpath("gui").mkdir()
845
846 # no ini file
847 result = pytester.runpytest()
848 result.stdout.fnmatch_lines(["rootdir: *test_header0"])
849
850 # with configfile
851 pytester.makeini("""[pytest]""")
852 result = pytester.runpytest()
853 result.stdout.fnmatch_lines(["rootdir: *test_header0, configfile: tox.ini"])
854
855 # with testpaths option, and not passing anything in the command-line
856 pytester.makeini(
857 """
858 [pytest]
859 testpaths = tests gui
860 """
861 )
862 result = pytester.runpytest()
863 result.stdout.fnmatch_lines(
864 ["rootdir: *test_header0, configfile: tox.ini, testpaths: tests, gui"]
865 )
866
867 # with testpaths option, passing directory in command-line: do not show testpaths then
868 result = pytester.runpytest("tests")
869 result.stdout.fnmatch_lines(["rootdir: *test_header0, configfile: tox.ini"])
870
871 def test_header_absolute_testpath(
872 self, pytester: Pytester, monkeypatch: MonkeyPatch

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
runpytestMethod · 0.45
makeiniMethod · 0.45

Tested by

no test coverage detected