mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Add the function/method name to assertRaises.
This commit is contained in:
		
							parent
							
								
									a098294446
								
							
						
					
					
						commit
						2b6a97e69c
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -311,9 +311,10 @@ def failUnlessRaises(self, excClass, callableObj, *args, **kwargs): | ||||||
|         except excClass: |         except excClass: | ||||||
|             return |             return | ||||||
|         else: |         else: | ||||||
|             if hasattr(excClass,'__name__'): excName = excClass.__name__ |             excName = str(getattr(excClass, '__name__', excClass)) | ||||||
|             else: excName = str(excClass) |             objName = str(getattr(callableObj, '__name__', callableObj)) | ||||||
|             raise self.failureException, "%s not raised" % excName |             raise self.failureException, "%s not raised by %s" % (excName, | ||||||
|  |                                                                   objName) | ||||||
| 
 | 
 | ||||||
|     def failUnlessEqual(self, first, second, msg=None): |     def failUnlessEqual(self, first, second, msg=None): | ||||||
|         """Fail if the two objects are unequal as determined by the '==' |         """Fail if the two objects are unequal as determined by the '==' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum