Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b33941a

Browse files
committed
Split the bigmem re test in two separate tests with different memory requirements.
2 parents e854433 + 1f1888e commit b33941a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/test/test_re.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,17 @@ def test_compile(self):
949949
# Test behaviour when not given a string or pattern as parameter
950950
self.assertRaises(TypeError, re.compile, 0)
951951

952+
@bigmemtest(size=_2G, memuse=1)
953+
def test_large_search(self, size):
954+
# Issue #10182: indices were 32-bit-truncated.
955+
s = 'a' * size
956+
m = re.search('$', s)
957+
self.assertIsNotNone(m)
958+
952959
# The huge memuse is because of re.sub() using a list and a join()
953960
# to create the replacement result.
954-
@bigmemtest(size=_2G, memuse=20)
955-
def test_large(self, size):
961+
@bigmemtest(size=_2G, memuse=16 + 2)
962+
def test_large_subn(self, size):
956963
# Issue #10182: indices were 32-bit-truncated.
957964
s = 'a' * size
958965
m = re.search('$', s)

0 commit comments

Comments
 (0)