Skip to content

Commit 2449441

Browse files
authored
[3.12] gh-117594: Require cpu resource to test_search_anchor_at_beginning (g… (gh-117616)
gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595) (cherry picked from commit 784623c)
1 parent 558b517 commit 2449441

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_re.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from test.support import (gc_collect, bigmemtest, _2G,
22
cpython_only, captured_stdout,
33
check_disallow_instantiation, is_emscripten, is_wasi,
4-
SHORT_TIMEOUT)
4+
SHORT_TIMEOUT, requires_resource)
55
import locale
66
import re
77
import string
@@ -2217,6 +2217,9 @@ def test_bug_40736(self):
22172217
with self.assertRaisesRegex(TypeError, "got 'type'"):
22182218
re.search("x*", type)
22192219

2220+
# gh-117594: The test is not slow by itself, but it relies on
2221+
# the absolute computation time and can fail on very slow computers.
2222+
@requires_resource('cpu')
22202223
def test_search_anchor_at_beginning(self):
22212224
s = 'x'*10**7
22222225
start = time.perf_counter()

0 commit comments

Comments
 (0)