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

Function test_syspath_prepend

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

Source from the content-addressed store, hash-verified

271
272
273def test_syspath_prepend(mp: MonkeyPatch) -> None:
274 old = list(sys.path)
275 mp.syspath_prepend("world")
276 mp.syspath_prepend("hello")
277 assert sys.path[0] == "hello"
278 assert sys.path[1] == "world"
279 mp.undo()
280 assert sys.path == old
281 mp.undo()
282 assert sys.path == old
283
284
285def test_syspath_prepend_double_undo(mp: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

syspath_prependMethod · 0.80
undoMethod · 0.80

Tested by

no test coverage detected