summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-10-06 20:32:10 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-10-06 20:32:10 (GMT)
commitb6080b696762a4998e1ed8bd3532f53b960959a7 (patch)
tree28050032e974f09bf45e7944f711716a2f2e2282
parenta5d9917d21556a655400d4597ee09accfafa6f45 (diff)
downloadcpython-b6080b696762a4998e1ed8bd3532f53b960959a7.zip
cpython-b6080b696762a4998e1ed8bd3532f53b960959a7.tar.gz
cpython-b6080b696762a4998e1ed8bd3532f53b960959a7.tar.bz2
Fix size estimate for test_unicode_repr
-rw-r--r--Lib/test/test_bigmem.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_bigmem.py b/Lib/test/test_bigmem.py
index 32523e4..4353602 100644
--- a/Lib/test/test_bigmem.py
+++ b/Lib/test/test_bigmem.py
@@ -701,7 +701,13 @@ class StrTest(unittest.TestCase, BaseStrTest):
self.assertEqual(s.count('\\'), size)
self.assertEqual(s.count('0'), size * 2)
- @bigmemtest(size=_2G // 5 + 1, memuse=ucs2_char_size + ascii_char_size * 6)
+ # ascii() calls encode('ascii', 'backslashreplace'), which itself
+ # creates a temporary Py_UNICODE representation in addition to the
+ # original (Py_UCS2) one
+ # There's also some overallocation when resizing the ascii() result
+ # that isn't taken into account here.
+ @bigmemtest(size=_2G // 5 + 1, memuse=ucs2_char_size +
+ ucs4_char_size + ascii_char_size * 6)
def test_unicode_repr(self, size):
# Use an assigned, but not printable code point.
# It is in the range of the low surrogates \uDC00-\uDFFF.