Skip to content

Commit 784623c

Browse files
authored
gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)
1 parent fd36790 commit 784623c

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-
warnings_helper, SHORT_TIMEOUT, CPUStopwatch)
4+
warnings_helper, SHORT_TIMEOUT, CPUStopwatch, requires_resource)
55
import locale
66
import re
77
import string
@@ -2282,6 +2282,9 @@ def test_bug_40736(self):
22822282
with self.assertRaisesRegex(TypeError, "got 'type'"):
22832283
re.search("x*", type)
22842284

2285+
# gh-117594: The test is not slow by itself, but it relies on
2286+
# the absolute computation time and can fail on very slow computers.
2287+
@requires_resource('cpu')
22852288
def test_search_anchor_at_beginning(self):
22862289
s = 'x'*10**7
22872290
with CPUStopwatch() as stopwatch:

0 commit comments

Comments
 (0)