(self)
| 732 | self._sys_path_snapshot.restore() |
| 733 | |
| 734 | def __take_sys_modules_snapshot(self) -> SysModulesSnapshot: |
| 735 | # Some zope modules used by twisted-related tests keep internal state |
| 736 | # and can't be deleted; we had some trouble in the past with |
| 737 | # `zope.interface` for example. |
| 738 | # |
| 739 | # Preserve readline due to https://bugs.python.org/issue41033. |
| 740 | # pexpect issues a SIGWINCH. |
| 741 | def preserve_module(name): |
| 742 | return name.startswith(("zope", "readline")) |
| 743 | |
| 744 | return SysModulesSnapshot(preserve=preserve_module) |
| 745 | |
| 746 | def make_hook_recorder(self, pluginmanager: PytestPluginManager) -> HookRecorder: |
| 747 | """Create a new :class:`HookRecorder` for a :class:`PytestPluginManager`.""" |
no test coverage detected