Skip to content

Commit 49ae371

Browse files
committed
Change test
1 parent 2c70bfe commit 49ae371

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_capi/test_abstract.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ def test_copy_to_object(self):
343343
s1 = _testcapi.object_copy_to_object(bytes(5), 'abcde', 'C')
344344
s2 = _testcapi.object_copy_to_object(bytes(5), 'abcde', 'F')
345345
s3 = _testcapi.object_copy_to_object(bytes(5), 'abcde', 'A')
346+
try:
347+
_testcapi.object_copy_to_object(bytes(4), 'abcde', 'A')
348+
_testcapi.object_copy_to_object(list(), 'abcde', 'A')
349+
except BufferError as e:
350+
self.assertIsInstance(e, BufferError)
351+
except TypeError as e:
352+
self.assertIsInstance(e, TypeError)
346353
self.assertEqual(s1, s2)
347354
self.assertEqual(s2, s3)
348355
self.assertEqual(s1, s3)

0 commit comments

Comments
 (0)