summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rossi <chris@archimedeanco.com>2014-07-21 17:26:17 -0400
committerChris Rossi <chris@archimedeanco.com>2014-07-21 17:26:17 -0400
commit026e292aa8d6da7a2e62eab05d8ceb5f061ac44e (patch)
tree49a1a2da65a02763561ad4b1895ff299b395383a
parent6596304446f8369dfbcf264d143fe85d75832dba (diff)
downloadpyramid-026e292aa8d6da7a2e62eab05d8ceb5f061ac44e.tar.gz
pyramid-026e292aa8d6da7a2e62eab05d8ceb5f061ac44e.tar.bz2
pyramid-026e292aa8d6da7a2e62eab05d8ceb5f061ac44e.zip
Fix tests on py26.
-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()