diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-02-01 23:00:19 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-02-01 23:00:19 (GMT) |
commit | 71cf91cc09f8639cd66af9b9cd592700a44e121b (patch) | |
tree | 5b6fa627075b01a208052fee57cea09a9798a29e /Lib/test/test_json | |
parent | e74050471be8c924a80045bfff5e696e300451df (diff) | |
parent | 3675cd9db1d7eda965df81357a11dd40e41090f7 (diff) | |
download | cpython-71cf91cc09f8639cd66af9b9cd592700a44e121b.zip cpython-71cf91cc09f8639cd66af9b9cd592700a44e121b.tar.gz cpython-71cf91cc09f8639cd66af9b9cd592700a44e121b.tar.bz2 |
merge 3.4 (#23369)
Diffstat (limited to 'Lib/test/test_json')
-rw-r--r-- | Lib/test/test_json/test_encode_basestring_ascii.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_json/test_encode_basestring_ascii.py b/Lib/test/test_json/test_encode_basestring_ascii.py index 3a4ad18..5c363dc 100644 --- a/Lib/test/test_json/test_encode_basestring_ascii.py +++ b/Lib/test/test_json/test_encode_basestring_ascii.py @@ -1,5 +1,6 @@ from collections import OrderedDict from test.test_json import PyTest, CTest +from test.support import bigaddrspacetest CASES = [ @@ -38,4 +39,10 @@ class TestEncodeBasestringAscii: class TestPyEncodeBasestringAscii(TestEncodeBasestringAscii, PyTest): pass -class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest): pass +class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest): + @bigaddrspacetest + def test_overflow(self): + s = "\uffff"*((2**32)//6 + 1) + with self.assertRaises(OverflowError): + self.json.encoder.encode_basestring_ascii(s) + |