[Python-checkins] cpython (3.2): Split the bigmem re test in two separate tests with different memory
antoine.pitrou
python-checkins at python.org
Mon Dec 3 20:58:40 CET 2012
http://hg.python.org/cpython/rev/70ebb4d3b356
changeset: 80710:70ebb4d3b356
branch: 3.2
parent: 80707:b742bbf6b07f
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon Dec 03 20:53:12 2012 +0100
summary:
Split the bigmem re test in two separate tests with different memory requirements.
files:
Lib/test/test_re.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -7,6 +7,9 @@
import traceback
from weakref import proxy
+from test.test_bigmem import character_size
+
+
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
@@ -854,10 +857,17 @@
# Test behaviour when not given a string or pattern as parameter
self.assertRaises(TypeError, re.compile, 0)
+ @bigmemtest(size=_2G, memuse=character_size)
+ def test_large_search(self, size):
+ # Issue #10182: indices were 32-bit-truncated.
+ s = 'a' * size
+ m = re.search('$', s)
+ self.assertIsNotNone(m)
+
# The huge memuse is because of re.sub() using a list and a join()
# to create the replacement result.
- @bigmemtest(size=_2G, memuse=20)
- def test_large(self, size):
+ @bigmemtest(size=_2G, memuse=16 + 2 * character_size)
+ def test_large_subn(self, size):
# Issue #10182: indices were 32-bit-truncated.
s = 'a' * size
m = re.search('$', s)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list