]> granicus.if.org Git - python/commitdiff
Split the bigmem re test in two separate tests with different memory requirements.
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 3 Dec 2012 19:55:56 +0000 (20:55 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 3 Dec 2012 19:55:56 +0000 (20:55 +0100)
1  2 
Lib/test/test_re.py

index 82179b78c9e4c2bd6dd8ac622f21f23702bf8848,96a6bcedc8ec0979dea75dd366b7426b64f20d1d..28944b1c7809903d4f676f65e50bfc6197763716
@@@ -949,10 -857,17 +949,17 @@@ class ReTests(unittest.TestCase)
          # Test behaviour when not given a string or pattern as parameter
          self.assertRaises(TypeError, re.compile, 0)
  
 -    @bigmemtest(size=_2G, memuse=character_size)
++    @bigmemtest(size=_2G, memuse=1)
+     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)
++    @bigmemtest(size=_2G, memuse=16 + 2)
+     def test_large_subn(self, size):
          # Issue #10182: indices were 32-bit-truncated.
          s = 'a' * size
          m = re.search('$', s)