mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072.
This commit is contained in:
		
							parent
							
								
									a4e0efa4b1
								
							
						
					
					
						commit
						a50af06931
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		|  | @ -352,7 +352,7 @@ def __init__(self, methodName='runTest'): | |||
|            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 @@ def run(self, result=None): | |||
|             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 @@ def run(self, result=None): | |||
|     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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Michael Foord
						Michael Foord