[Python-3000-checkins] r63811 - python/branches/py3k/Lib/test/test_bytes.py

georg.brandl python-3000-checkins at python.org
Fri May 30 14:05:02 CEST 2008


Author: georg.brandl
Date: Fri May 30 14:05:02 2008
New Revision: 63811

Log:
Add test case for r63810.


Modified:
   python/branches/py3k/Lib/test/test_bytes.py

Modified: python/branches/py3k/Lib/test/test_bytes.py
==============================================================================
--- python/branches/py3k/Lib/test/test_bytes.py	(original)
+++ python/branches/py3k/Lib/test/test_bytes.py	Fri May 30 14:05:02 2008
@@ -832,6 +832,11 @@
     def test_rsplit_bytearray(self):
         self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
 
+    def test_return_self(self):
+        # bytearray.replace must always return a new bytearray
+        b = bytearray()
+        self.failIf(b.replace(b'', b'') is b)
+
     # Optimizations:
     # __iter__? (optimization)
     # __reversed__? (optimization)


More information about the Python-3000-checkins mailing list