Skip to content

Commit 19ee229

Browse files
committed
test: error message on %i format
1 parent 38255f6 commit 19ee229

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_bytes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import array
8+
import operator
89
import os
910
import re
1011
import sys
@@ -751,6 +752,8 @@ def check(fmt, vals, result):
751752
check(b'%i%b %*.*b', (10, b'3', 5, 3, b'abc',), b'103 abc')
752753
check(b'%c', b'a', b'a')
753754

755+
self.assertRaisesRegex(TypeError, '%i format: a real number is required, not complex', operator.mod, '%i', 2j)
756+
754757
def test_imod(self):
755758
b = self.type2test(b'hello, %b!')
756759
orig = b

0 commit comments

Comments
 (0)