Skip to content

Commit

Permalink
Clarify dereferencing comment in DynamicPatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgeheeiv authored and mrbean-bremen committed Nov 17, 2019
1 parent ba38ced commit 0215fa9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyfakefs/fake_filesystem_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,9 @@ def cleanup(self):
reload(module)
reloaded_module_names = [module.__name__
for module in self._patcher.modules_to_reload]
# force all modules loaded during the test to reload on next use,
# to ensure that no faked modules are still hold in these modules
# Dereference all modules loaded during the test so they will reload on
# the next use, 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:
del sys.modules[name]
Expand Down

0 comments on commit 0215fa9

Please sign in to comment.