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

Function test_setenv_prepend

testing/test_monkeypatch.py:224–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222
223
224def test_setenv_prepend() -> None:
225 import os
226
227 monkeypatch = MonkeyPatch()
228 monkeypatch.setenv("XYZ123", "2", prepend="-")
229 monkeypatch.setenv("XYZ123", "3", prepend="-")
230 assert os.environ["XYZ123"] == "3-2"
231 monkeypatch.undo()
232 assert "XYZ123" not in os.environ
233
234
235def test_monkeypatch_plugin(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

setenvMethod · 0.95
undoMethod · 0.95
MonkeyPatchClass · 0.90

Tested by

no test coverage detected