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

Method preserve

testing/test_pytester.py:356–357  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

354 original = dict(sys.modules)
355
356 def preserve(name):
357 return name in (key[0], key[1], "some-other-key")
358
359 snapshot = SysModulesSnapshot(preserve=preserve)
360 sys.modules[key[0]] = original[key[0]] = ModuleType("something else0")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected