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

Function test_setenv

testing/test_monkeypatch.py:199–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197
198
199def test_setenv() -> None:
200 monkeypatch = MonkeyPatch()
201 with pytest.warns(pytest.PytestWarning):
202 monkeypatch.setenv("XYZ123", 2) # type: ignore[arg-type]
203 import os
204
205 assert os.environ["XYZ123"] == "2"
206 monkeypatch.undo()
207 assert "XYZ123" not in os.environ
208
209
210def 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