]> granicus.if.org Git - python/commitdiff
Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCas...
authorMichael Foord <fuzzyman@voidspace.org.uk>
Thu, 21 May 2009 22:57:02 +0000 (22:57 +0000)
committerMichael Foord <fuzzyman@voidspace.org.uk>
Thu, 21 May 2009 22:57:02 +0000 (22:57 +0000)
Lib/test/test_unittest.py
Lib/unittest.py

index d815a11389dea10895ba6fda31258830aa8b4e6b..4f89d87a51345c1cf293f6a7bd1f196eecda7f70 100644 (file)
@@ -3203,7 +3203,7 @@ class TestCleanUp(TestCase):
 
         result = MockResult()
         test = TestableTest('testNothing')
-        test._result = result
+        test._resultForDoCleanups = result
 
         exc1 = Exception('foo')
         exc2 = Exception('bar')
index 5858d89e485a9060f3659e91d2a9fca75a40e6b1..fce70f80103fd80efea47f1178ad89a895d22349 100644 (file)
@@ -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)