Test tearDown: remove all 'application.xxx' submodules from sys.modules
This ensures that the modules are reloaded for every test, for better test separation.
This commit is contained in:
parent
c871089eab
commit
2bdfbaea13
@ -69,6 +69,10 @@ class AbstractPillarTest(TestMinimal):
|
||||
# Not only delete self.app (like the superclass does),
|
||||
# but also un-import the application.
|
||||
del sys.modules['application']
|
||||
remove = [modname for modname in sys.modules
|
||||
if modname.startswith('application.')]
|
||||
for modname in remove:
|
||||
del sys.modules[modname]
|
||||
|
||||
def ensure_file_exists(self, file_overrides=None):
|
||||
self.ensure_project_exists()
|
||||
|
Loading…
x
Reference in New Issue
Block a user