Mailing List Archive

gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)
https://github.com/python/cpython/commit/784623c63c45a4d13dfb04318c39fdb1ab790218
commit: 784623c63c45a4d13dfb04318c39fdb1ab790218
branch: main
author: Donghee Na <donghee.na@python.org>
committer: corona10 <donghee.na92@gmail.com>
date: 2024-04-07T23:58:19Z
summary:

gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)

files:
M Lib/test/test_re.py

diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index b1ac22c28cf7c1..b8b50e8b3c2190 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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 @@ 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
with CPUStopwatch() as stopwatch:

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com