summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/case.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-06-08 22:44:52 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-06-08 22:44:52 (GMT)
commit0fedb28951034e0ee3c5cd4761257d85a5fd4da2 (patch)
treee5a2dc058a09a8c626475352f4ca0598110bd9c1 /Lib/unittest/case.py
parentd7afd31a9bef6e0498e8fce646a2d4e8e8576e87 (diff)
downloadcpython-0fedb28951034e0ee3c5cd4761257d85a5fd4da2.zip
cpython-0fedb28951034e0ee3c5cd4761257d85a5fd4da2.tar.gz
cpython-0fedb28951034e0ee3c5cd4761257d85a5fd4da2.tar.bz2
Issue 8948. cleanup functions are not run by unittest.TestCase.debug(), plus class and module teardowns are not run by unittest.TestSuite.debug().
Diffstat (limited to 'Lib/unittest/case.py')
-rw-r--r--Lib/unittest/case.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 8341b88..b609caf 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -380,6 +380,9 @@ class TestCase(object):
self.setUp()
getattr(self, self._testMethodName)()
self.tearDown()
+ while self._cleanups:
+ function, args, kwargs = self._cleanups.pop(-1)
+ function(*args, **kwargs)
def skipTest(self, reason):
"""Skip this test."""