summaryrefslogtreecommitdiffstats
path: root/debian/patches/0003-fix-nose-leftovers.patch
blob: c35d7eebf6ba9d15e788aef7136e35ddf369f8af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: =?utf-8?q?Piotr_O=C5=BCarowski?= <piotr@debian.org>
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)