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

Function test_pytest_addopts_before_pytester

testing/test_pytester.py:620–628  ·  view source on GitHub ↗
(request, monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

618
619
620def test_pytest_addopts_before_pytester(request, monkeypatch: MonkeyPatch) -> None:
621 orig = os.environ.get("PYTEST_ADDOPTS", None)
622 monkeypatch.setenv("PYTEST_ADDOPTS", "--orig-unused")
623 pytester: Pytester = request.getfixturevalue("pytester")
624 assert "PYTEST_ADDOPTS" not in os.environ
625 pytester._finalize()
626 assert os.environ.get("PYTEST_ADDOPTS") == "--orig-unused"
627 monkeypatch.undo()
628 assert os.environ.get("PYTEST_ADDOPTS") == orig
629
630
631def test_run_stdin(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

setenvMethod · 0.80
getfixturevalueMethod · 0.80
undoMethod · 0.80
getMethod · 0.45
_finalizeMethod · 0.45

Tested by

no test coverage detected