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

Method restore

src/_pytest/pytester.py:632–638  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

630 self.__saved = dict(sys.modules)
631
632 def restore(self) -> None:
633 if self.__preserve:
634 self.__saved.update(
635 (k, m) for k, m in sys.modules.items() if self.__preserve(k)
636 )
637 sys.modules.clear()
638 sys.modules.update(self.__saved)
639
640
641class SysPathsSnapshot:

Callers 6

_sys_snapshotFunction · 0.95
test_remove_addedMethod · 0.95
test_add_removedMethod · 0.95
test_restore_reloadedMethod · 0.95
test_preserve_modulesMethod · 0.95

Calls 2

updateMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected