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

Function test_syspath_prepend

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

Source from the content-addressed store, hash-verified

244
245
246def test_syspath_prepend(mp: MonkeyPatch) -> None:
247 old = list(sys.path)
248 mp.syspath_prepend("world")
249 mp.syspath_prepend("hello")
250 assert sys.path[0] == "hello"
251 assert sys.path[1] == "world"
252 mp.undo()
253 assert sys.path == old
254 mp.undo()
255 assert sys.path == old
256
257
258def 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