mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Merged revisions 77475 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77475 | antoine.pitrou | 2010-01-13 16:02:13 +0100 (mer., 13 janv. 2010) | 4 lines Issue #7625: Add more tests that bytearray methods return new objects, even if identical. Patch by Florent Xicluna (again). ........
This commit is contained in:
		
							parent
							
								
									8e33fd78c4
								
							
						
					
					
						commit
						cbaa6250b9
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -972,7 +972,13 @@ def test_returns_new_copy(self): | ||||||
|             self.assertEqual(val, newval) |             self.assertEqual(val, newval) | ||||||
|             self.assertTrue(val is not newval, |             self.assertTrue(val is not newval, | ||||||
|                             methname+' returned self on a mutable object') |                             methname+' returned self on a mutable object') | ||||||
| 
 |         for expr in ('val.split()[0]', 'val.rsplit()[0]', | ||||||
|  |                      'val.partition(b".")[0]', 'val.rpartition(b".")[2]', | ||||||
|  |                      'val.splitlines()[0]', 'val.replace(b"", b"")'): | ||||||
|  |             newval = eval(expr) | ||||||
|  |             self.assertEqual(val, newval) | ||||||
|  |             self.assertTrue(val is not newval, | ||||||
|  |                             expr+' returned val on a mutable object') | ||||||
| 
 | 
 | ||||||
| class FixedStringTest(test.string_tests.BaseTest): | class FixedStringTest(test.string_tests.BaseTest): | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Antoine Pitrou
						Antoine Pitrou