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

Method test_append_parse_args

testing/test_config.py:83–100  ·  view source on GitHub ↗
(
        self, pytester: Pytester, tmp_path: Path, monkeypatch: MonkeyPatch
    )

Source from the content-addressed store, hash-verified

81 assert result.ret == 0
82
83 def test_append_parse_args(
84 self, pytester: Pytester, tmp_path: Path, monkeypatch: MonkeyPatch
85 ) -> None:
86 monkeypatch.setenv("PYTEST_ADDOPTS", '--color no -rs --tb="short"')
87 tmp_path.joinpath("pytest.ini").write_text(
88 textwrap.dedent(
89 """\
90 [pytest]
91 addopts = --verbose
92 """
93 ),
94 encoding="utf-8",
95 )
96 config = pytester.parseconfig(tmp_path)
97 assert config.option.color == "no"
98 assert config.option.reportchars == "s"
99 assert config.option.tbstyle == "short"
100 assert config.option.verbose
101
102 @pytest.mark.parametrize("flag", ("-r", "--report-chars="))
103 @pytest.mark.parametrize("value", ("fE", "A", "fs"))

Callers

nothing calls this directly

Calls 3

setenvMethod · 0.80
write_textMethod · 0.80
parseconfigMethod · 0.45

Tested by

no test coverage detected