summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2009-05-21 22:57:02 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2009-05-21 22:57:02 (GMT)
commita50af069318213a8e129e9fc02745446517797f0 (patch)
treebbc58e5aabe0aefdb485fa66a7d8c12f1a32cd7b /Lib
parenta4e0efa4b13e9a51faad19be27b18ed02c9a26f0 (diff)
downloadcpython-a50af069318213a8e129e9fc02745446517797f0.zip
cpython-a50af069318213a8e129e9fc02745446517797f0.tar.gz
cpython-a50af069318213a8e129e9fc02745446517797f0.tar.bz2
Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_unittest.py2
-rw-r--r--Lib/unittest.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index d815a11..4f89d87 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -3203,7 +3203,7 @@ class TestCleanUp(TestCase):
result = MockResult()
test = TestableTest('testNothing')
- test._result = result
+ test._resultForDoCleanups = result
exc1 = Exception('foo')
exc2 = Exception('bar')
diff --git a/Lib/unittest.py b/Lib/unittest.py
index 5858d89..fce70f8 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -352,7 +352,7 @@ class TestCase(object):
not have a method with the specified name.
"""
self._testMethodName = methodName
- self._result = None
+ self._resultForDoCleanups = None
try:
testMethod = getattr(self, methodName)
except AttributeError:
@@ -456,7 +456,7 @@ class TestCase(object):
if startTestRun is not None:
startTestRun()
- self._result = result
+ self._resultForDoCleanups = result
result.startTest(self)
testMethod = getattr(self, self._testMethodName)
try:
@@ -503,7 +503,7 @@ class TestCase(object):
def doCleanups(self):
"""Execute all cleanup functions. Normally called for you after
tearDown."""
- result = self._result
+ result = self._resultForDoCleanups
ok = True
while self._cleanups:
function, args, kwargs = self._cleanups.pop(-1)