]> granicus.if.org Git - python/commitdiff
reduce memory usage of test (closes #23369)
authorBenjamin Peterson <benjamin@python.org>
Mon, 2 Feb 2015 22:47:07 +0000 (17:47 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 2 Feb 2015 22:47:07 +0000 (17:47 -0500)
Lib/test/test_json/test_encode_basestring_ascii.py

index a2bbc7d5eef8b5c367482bed40a0bcd54081f0d6..2122da17fd61a3950e1ee9ce857af84de202ef81 100644 (file)
@@ -45,6 +45,7 @@ class TestPyEncodeBasestringAscii(TestEncodeBasestringAscii, PyTest): pass
 class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest):
     @bigaddrspacetest
     def test_overflow(self):
-        s = "\uffff"*((2**32)//6 + 1)
+        size = (2**32)//6 + 1
+        s = "\x00"*size
         with self.assertRaises(OverflowError):
             self.json.encoder.encode_basestring_ascii(s)