summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-13 15:03:39 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-13 15:03:39 (GMT)
commitcbaa6250b9c58787cd6b2edd41477a3e87d63148 (patch)
treec19704cec61e581a22d441f3a30912d1fc64a1c0
parent8e33fd78c4db7b250995652510067d7f3a8117cd (diff)
downloadcpython-cbaa6250b9c58787cd6b2edd41477a3e87d63148.zip
cpython-cbaa6250b9c58787cd6b2edd41477a3e87d63148.tar.gz
cpython-cbaa6250b9c58787cd6b2edd41477a3e87d63148.tar.bz2
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). ........
-rw-r--r--Lib/test/test_bytes.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index f844628..a4e5bd9 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -972,7 +972,13 @@ class BytearrayPEP3137Test(unittest.TestCase,
self.assertEqual(val, newval)
self.assertTrue(val is not newval,
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):