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

Function test_syspath_prepend_double_undo

testing/test_monkeypatch.py:258–267  ·  view source on GitHub ↗
(mp: MonkeyPatch)

Source from the content-addressed store, hash-verified

256
257
258def test_syspath_prepend_double_undo(mp: MonkeyPatch) -> None:
259 old_syspath = sys.path[:]
260 try:
261 mp.syspath_prepend("hello world")
262 mp.undo()
263 sys.path.append("more hello world")
264 mp.undo()
265 assert sys.path[-1] == "more hello world"
266 finally:
267 sys.path[:] = old_syspath
268
269
270def test_chdir_with_path_local(mp: MonkeyPatch, tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

syspath_prependMethod · 0.80
undoMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected