From 026e292aa8d6da7a2e62eab05d8ceb5f061ac44e Mon Sep 17 00:00:00 2001 From: Chris Rossi Date: Mon, 21 Jul 2014 17:26:17 -0400 Subject: Fix tests on py26. --- pyramid/tests/test_static.py | 10 +++++++--- 1 file 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() -- cgit v1.2.3