Skip to content

Commit

Permalink
pythongh-117594: Require cpu resource to test_search_anchor_at_beginn…
Browse files Browse the repository at this point in the history
…ing (pythongh-117595)

(cherry picked from commit 784623c)
  • Loading branch information
corona10 committed Apr 8, 2024
1 parent 558b517 commit 9abe12b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_re.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from test.support import (gc_collect, bigmemtest, _2G,
cpython_only, captured_stdout,
check_disallow_instantiation, is_emscripten, is_wasi,
SHORT_TIMEOUT)
SHORT_TIMEOUT, requires_resource)
import locale
import re
import string
Expand Down Expand Up @@ -2217,6 +2217,9 @@ def test_bug_40736(self):
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
start = time.perf_counter()
Expand Down

0 comments on commit 9abe12b

Please sign in to comment.