MCPcopy
hub / github.com/pytest-dev/pytest / test_header

Method test_header

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

Source from the content-addressed store, hash-verified

936 result.stdout.no_fnmatch_line("plugins: *")
937
938 def test_header(self, pytester: Pytester) -> None:
939 pytester.path.joinpath("tests").mkdir()
940 pytester.path.joinpath("gui").mkdir()
941
942 # no configuration file
943 result = pytester.runpytest()
944 result.stdout.fnmatch_lines(["rootdir: *test_header0"])
945
946 # with configfile
947 pytester.makeini("""[pytest]""")
948 result = pytester.runpytest()
949 result.stdout.fnmatch_lines(["rootdir: *test_header0", "configfile: tox.ini"])
950
951 # with testpaths option, and not passing anything in the command-line
952 pytester.makeini(
953 """
954 [pytest]
955 testpaths = tests gui
956 """
957 )
958 result = pytester.runpytest()
959 result.stdout.fnmatch_lines(
960 ["rootdir: *test_header0", "configfile: tox.ini", "testpaths: tests, gui"]
961 )
962
963 # with testpaths option, passing directory in command-line: do not show testpaths then
964 result = pytester.runpytest("tests")
965 result.stdout.fnmatch_lines(["rootdir: *test_header0", "configfile: tox.ini"])
966
967 def test_header_absolute_testpath(
968 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