summaryrefslogtreecommitdiff
path: root/Lib/unittest/suite.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-09-01 07:58:41 +0300
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-09-01 07:58:41 +0300
commit0d0d20daff21fe874494eed8455ba64fd00c6df4 (patch)
tree6d8a3ee22536d54033f2d685cb73f6f24a6d1e5d /Lib/unittest/suite.py
parent4649d854693f21887aa90c9336dd87241ba6fb6a (diff)
downloadcpython-0d0d20daff21fe874494eed8455ba64fd00c6df4.tar.gz
Issue #11798: fix tests for regrtest -R :
Diffstat (limited to 'Lib/unittest/suite.py')
-rw-r--r--Lib/unittest/suite.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py
index 176af57fb0..ca82765b9c 100644
--- a/Lib/unittest/suite.py
+++ b/Lib/unittest/suite.py
@@ -16,6 +16,8 @@ def _call_if_exists(parent, attr):
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
+ _cleanup = True
+
def __init__(self, tests=()):
self._tests = []
self.addTests(tests)
@@ -61,7 +63,8 @@ class BaseTestSuite(object):
if result.shouldStop:
break
test(result)
- self._removeTestAtIndex(index)
+ if self._cleanup:
+ self._removeTestAtIndex(index)
return result
def _removeTestAtIndex(self, index):
@@ -115,7 +118,8 @@ class TestSuite(BaseTestSuite):
else:
test.debug()
- self._removeTestAtIndex(index)
+ if self._cleanup:
+ self._removeTestAtIndex(index)
if topLevel:
self._tearDownPreviousClass(None, result)