summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fnmatch.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-07-10 13:52:13 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-07-10 13:52:13 (GMT)
commit0425a8ea729617a74ab343909687d98216d25524 (patch)
tree40bf391a27838e4c86970262d485e834b36d50b1 /Lib/test/test_fnmatch.py
parenta85148352773929e11324f3786ebe5a78f372d94 (diff)
downloadcpython-0425a8ea729617a74ab343909687d98216d25524.zip
cpython-0425a8ea729617a74ab343909687d98216d25524.tar.gz
cpython-0425a8ea729617a74ab343909687d98216d25524.tar.bz2
Fix 'refleak' introduced by fnmatch cache purge tests.
This introduces a 'purge' function for the fnmatch module analogous to the 'purge' function in the re module.
Diffstat (limited to 'Lib/test/test_fnmatch.py')
-rw-r--r--Lib/test/test_fnmatch.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py
index 81b9ce6..496f145 100644
--- a/Lib/test/test_fnmatch.py
+++ b/Lib/test/test_fnmatch.py
@@ -3,10 +3,14 @@
from test import support
import unittest
-from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb
+from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb, purge
class FnmatchTestCase(unittest.TestCase):
+
+ def tearDown(self):
+ purge()
+
def check_match(self, filename, pattern, should_match=1, fn=fnmatch):
if should_match:
self.assertTrue(fn(filename, pattern),