summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-03 17:53:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-03 17:53:46 (GMT)
commit41525e31a5a40c1c20a5115aed9609f49c60b43a (patch)
tree45340b82cb8c98bb088b5b3227a3e5b9e6464603 /Lib/test/test_format.py
parent45ec3288d0e181334efcaeac7ce6ef44771a2689 (diff)
downloadcpython-41525e31a5a40c1c20a5115aed9609f49c60b43a.zip
cpython-41525e31a5a40c1c20a5115aed9609f49c60b43a.tar.gz
cpython-41525e31a5a40c1c20a5115aed9609f49c60b43a.tar.bz2
Issue #23466: Raised OverflowError if %c argument is out of range.
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 5a2a357..2dad958 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -358,12 +358,12 @@ class FormatTest(unittest.TestCase):
"not all arguments converted during bytes formatting")
test_exc(b'no format', bytearray(b'1'), TypeError,
"not all arguments converted during bytes formatting")
- test_exc(b"%c", -1, TypeError,
- "%c requires an integer in range(256) or a single byte")
- test_exc(b"%c", 256, TypeError,
- "%c requires an integer in range(256) or a single byte")
- test_exc(b"%c", 2**128, TypeError,
- "%c requires an integer in range(256) or a single byte")
+ test_exc(b"%c", -1, OverflowError,
+ "%c arg not in range(256)")
+ test_exc(b"%c", 256, OverflowError,
+ "%c arg not in range(256)")
+ test_exc(b"%c", 2**128, OverflowError,
+ "%c arg not in range(256)")
test_exc(b"%c", b"Za", TypeError,
"%c requires an integer in range(256) or a single byte")
test_exc(b"%c", "Y", TypeError,