diff options
author | Donghee Na <donghee.na@python.org> | 2024-04-08 08:58:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-07 23:58:19 +0000 |
commit | 784623c63c45a4d13dfb04318c39fdb1ab790218 (patch) | |
tree | 2d218ff72fb476261ce7023d05ca726b2f185fe2 /Lib/test/test_re.py | |
parent | fd3679025d9d0da7eb11f2810ed270c214926992 (diff) | |
download | cpython-784623c63c45a4d13dfb04318c39fdb1ab790218.tar.gz cpython-784623c63c45a4d13dfb04318c39fdb1ab790218.zip |
gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index b1ac22c28cf..b8b50e8b3c2 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 @@ 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: |