Skip to content

Commit

Permalink
Verify that it worked before
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Jan 11, 2024
1 parent fd43f6c commit 58b5c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyfakefs/fake_filesystem_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,12 +1094,12 @@ def cleanup(self) -> None:
# Reload all modules loaded and patched during the test, ensuring that
# no faked modules are referenced after the test.
for name in self._loaded_module_names:
# if name in sys.modules and name not in reloaded_module_names:
if name not in reloaded_module_names:
if name in sys.modules and name not in reloaded_module_names:
# in the unlikely case that the cache is turned off,
# we have to reload all modules
if not self._patcher.use_cache or name in Patcher.CACHED_MODULES:
reload(sys.modules[name])
# reload(sys.modules[name])
del sys.modules[name]

def needs_patch(self, name: str) -> bool:
"""Check if the module with the given name shall be replaced."""
Expand Down

0 comments on commit 58b5c7e

Please sign in to comment.