summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/tests/test_static.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py
index 6ae9b13db..aca5c4bbd 100644
--- a/pyramid/tests/test_static.py
+++ b/pyramid/tests/test_static.py
@@ -370,6 +370,7 @@ class Test_static_view_use_subpath_True(unittest.TestCase):
class TestMd5AssetTokenGenerator(unittest.TestCase):
_fspath = None
+ _tmp = None
@property
def fspath(self):
@@ -378,12 +379,15 @@ class TestMd5AssetTokenGenerator(unittest.TestCase):
import os
import tempfile
- import shutil
- tmp = tempfile.mkdtemp()
- self.addCleanup(lambda: shutil.rmtree(tmp))
+ self._tmp = tmp = tempfile.mkdtemp()
self._fspath = os.path.join(tmp, 'test.txt')
return self._fspath
+ def tearDown(self):
+ import shutil
+ if self._tmp:
+ shutil.rmtree(self._tmp)
+
def _makeOne(self):
from pyramid.static import Md5AssetTokenGenerator as cls
return cls()