]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)
authorDonghee Na <donghee.na@python.org>
Sun, 7 Apr 2024 23:58:19 +0000 (08:58 +0900)
committerGitHub <noreply@github.com>
Sun, 7 Apr 2024 23:58:19 +0000 (23:58 +0000)
Lib/test/test_re.py

index b1ac22c28cf7c136028b0aefe162215cb898caa1..b8b50e8b3c21908be26f66535b95c28579880461 100644 (file)
@@ -1,7 +1,7 @@
 from test.support import (gc_collect, bigmemtest, _2G,
                           cpython_only, captured_stdout,
                           check_disallow_instantiation, is_emscripten, is_wasi,
-                          warnings_helper, SHORT_TIMEOUT, CPUStopwatch)
+                          warnings_helper, SHORT_TIMEOUT, CPUStopwatch, requires_resource)
 import locale
 import re
 import string
@@ -2282,6 +2282,9 @@ class ReTests(unittest.TestCase):
         with self.assertRaisesRegex(TypeError, "got 'type'"):
             re.search("x*", type)
 
+    # gh-117594: The test is not slow by itself, but it relies on
+    # the absolute computation time and can fail on very slow computers.
+    @requires_resource('cpu')
     def test_search_anchor_at_beginning(self):
         s = 'x'*10**7
         with CPUStopwatch() as stopwatch: