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

Function test_setenv_prepend

testing/test_monkeypatch.py:251–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249
250
251def test_setenv_prepend() -> None:
252 import os
253
254 monkeypatch = MonkeyPatch()
255 monkeypatch.setenv("XYZ123", "2", prepend="-")
256 monkeypatch.setenv("XYZ123", "3", prepend="-")
257 assert os.environ["XYZ123"] == "3-2"
258 monkeypatch.undo()
259 assert "XYZ123" not in os.environ
260
261
262def 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