summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index a3804a9..71bb1e7 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -1599,6 +1599,13 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
a = bytearray(b'')
a.extend([Indexable(ord('a'))])
self.assertEqual(a, b'a')
+ a = bytearray(b'abc')
+ self.assertRaisesRegex(TypeError, # Override for string.
+ "expected iterable of integers; got: 'str'",
+ a.extend, 'def')
+ self.assertRaisesRegex(TypeError, # But not for others.
+ "can't extend bytearray with float",
+ a.extend, 1.0)
def test_remove(self):
b = bytearray(b'hello')