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.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 3520e83..3c09141 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -729,6 +729,12 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
self.assertEqual(PyBytes_FromFormat(b's:%s', c_char_p(b'cstr')),
b's:cstr')
+ # Issue #19969
+ self.assertRaises(OverflowError,
+ PyBytes_FromFormat, b'%c', c_int(-1))
+ self.assertRaises(OverflowError,
+ PyBytes_FromFormat, b'%c', c_int(256))
+
class ByteArrayTest(BaseBytesTest, unittest.TestCase):
type2test = bytearray