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

Function test_syspath_prepend_double_undo

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

Source from the content-addressed store, hash-verified

283
284
285def test_syspath_prepend_double_undo(mp: MonkeyPatch) -> None:
286 old_syspath = sys.path[:]
287 try:
288 mp.syspath_prepend("hello world")
289 mp.undo()
290 sys.path.append("more hello world")
291 mp.undo()
292 assert sys.path[-1] == "more hello world"
293 finally:
294 sys.path[:] = old_syspath
295
296
297def 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