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

Function test_setenv

testing/test_monkeypatch.py:173–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171
172
173def test_setenv() -> None:
174 monkeypatch = MonkeyPatch()
175 with pytest.warns(pytest.PytestWarning):
176 monkeypatch.setenv("XYZ123", 2) # type: ignore[arg-type]
177 import os
178
179 assert os.environ["XYZ123"] == "2"
180 monkeypatch.undo()
181 assert "XYZ123" not in os.environ
182
183
184def test_delenv() -> None:

Callers

nothing calls this directly

Calls 3

setenvMethod · 0.95
undoMethod · 0.95
MonkeyPatchClass · 0.90

Tested by

no test coverage detected