[Python-checkins] cpython (3.3): reduce memory usage of test (closes #23369)

benjamin.peterson python-checkins at python.org
Mon Feb 2 23:47:39 CET 2015


https://hg.python.org/cpython/rev/5c730d30ffbc
changeset:   94471:5c730d30ffbc
branch:      3.3
parent:      94456:7133582b6769
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Feb 02 17:47:07 2015 -0500
summary:
  reduce memory usage of test (closes #23369)

files:
  Lib/test/test_json/test_encode_basestring_ascii.py |  3 ++-
  1 files changed, 2 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
--- a/Lib/test/test_json/test_encode_basestring_ascii.py
+++ b/Lib/test/test_json/test_encode_basestring_ascii.py
@@ -45,6 +45,7 @@
 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)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list