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

Method test_remove_added

testing/test_pytester.py:318–325  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

316 key = "my-test-module"
317
318 def test_remove_added(self) -> None:
319 original = dict(sys.modules)
320 assert self.key not in sys.modules
321 snapshot = SysModulesSnapshot()
322 sys.modules[self.key] = ModuleType("something")
323 assert self.key in sys.modules
324 snapshot.restore()
325 assert sys.modules == original
326
327 def test_add_removed(self, monkeypatch: MonkeyPatch) -> None:
328 assert self.key not in sys.modules

Callers

nothing calls this directly

Calls 2

restoreMethod · 0.95
SysModulesSnapshotClass · 0.90

Tested by

no test coverage detected