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

Method test_addopts_before_initini

testing/test_config.py:2300–2309  ·  view source on GitHub ↗
(
        self, monkeypatch: MonkeyPatch, _config_for_test, _sys_snapshot
    )

Source from the content-addressed store, hash-verified

2298 result.stdout.fnmatch_lines(["*1 passed in*"])
2299
2300 def test_addopts_before_initini(
2301 self, monkeypatch: MonkeyPatch, _config_for_test, _sys_snapshot
2302 ) -> None:
2303 cache_dir = ".custom_cache"
2304 monkeypatch.setenv("PYTEST_ADDOPTS", f"-o cache_dir={cache_dir}")
2305 config = _config_for_test
2306 config.parse([], addopts=True)
2307 assert config._inicfg.get("cache_dir") == ConfigValue(
2308 cache_dir, origin="override", mode="ini"
2309 )
2310
2311 def test_addopts_from_env_not_concatenated(
2312 self, monkeypatch: MonkeyPatch, _config_for_test

Callers

nothing calls this directly

Calls 4

ConfigValueClass · 0.90
setenvMethod · 0.80
parseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected