From: =?utf-8?q?Piotr_O=C5=BCarowski?= Date: Fri, 24 Feb 2023 16:06:57 +0100 Subject: fix nose leftovers taken from upstream repo --- tests/test_loader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_loader.py b/tests/test_loader.py index 04c921d..77d686e 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -183,6 +183,7 @@ class TestFileSystemLoader: class TestModuleLoader: archive = None + mod_env = None def compile_down(self, prefix_loader, zip="deflated"): log = [] @@ -196,13 +197,14 @@ class TestModuleLoader: self.mod_env = Environment(loader=loaders.ModuleLoader(self.archive)) return "".join(log) - def teardown(self): - if hasattr(self, "mod_env"): + def teardown_method(self): + if self.archive is not None: if os.path.isfile(self.archive): os.remove(self.archive) else: shutil.rmtree(self.archive) self.archive = None + self.mod_env = None def test_log(self, prefix_loader): log = self.compile_down(prefix_loader)