def finalize(self):
self._sys_modules_snapshot.restore()<EOL>self._sys_path_snapshot.restore()<EOL>self._cwd_snapshot.restore()<EOL>self.monkeypatch.undo()<EOL>
Clean up global state artifacts.

        Some methods modify the global interpreter state and this tries to
        clean this up.  It does not remove the temporary directory however so
        it can be looked at after the test run has finished.