mirror of
				https://github.com/python/cpython.git
				synced 2025-11-01 06:01:29 +00:00 
			
		
		
		
	unittest.TestCase assertion methods inform you when they have omitted an over long diff on failure. Issue 8351.
This commit is contained in:
		
							parent
							
								
									ec27d91741
								
							
						
					
					
						commit
						5fe21ff91a
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -14,6 +14,10 @@ | |||
| 
 | ||||
| __unittest = True | ||||
| 
 | ||||
| 
 | ||||
| DIFF_OMITTED = ('\nDiff is %s characters long. ' | ||||
|                  'Set self.maxDiff to None to see it.') | ||||
| 
 | ||||
| class SkipTest(Exception): | ||||
|     """ | ||||
|     Raise this exception in a test to skip it. | ||||
|  | @ -700,7 +704,7 @@ def _truncateMessage(self, message, diff): | |||
|         max_diff = self.maxDiff | ||||
|         if max_diff is None or len(diff) <= max_diff: | ||||
|             return message + diff | ||||
|         return message | ||||
|         return message + (DIFF_OMITTED % len(diff)) | ||||
| 
 | ||||
|     def assertListEqual(self, list1, list2, msg=None): | ||||
|         """A list-specific equality assertion. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Michael Foord
						Michael Foord