GH-114911: use time.perf_counter in Stopwatch (GH-131469)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Chris Eibl 2025-04-28 13:55:08 +02:00 committed by GitHub
parent e577439803
commit 11f457cf41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 20 deletions

View file

@ -1,7 +1,7 @@
from test.support import (gc_collect, bigmemtest, _2G,
cpython_only, captured_stdout,
check_disallow_instantiation, linked_to_musl,
warnings_helper, SHORT_TIMEOUT, CPUStopwatch, requires_resource)
warnings_helper, SHORT_TIMEOUT, Stopwatch, requires_resource)
import locale
import re
import string
@ -2467,7 +2467,7 @@ class ReTests(unittest.TestCase):
@requires_resource('cpu')
def test_search_anchor_at_beginning(self):
s = 'x'*10**7
with CPUStopwatch() as stopwatch:
with Stopwatch() as stopwatch:
for p in r'\Ay', r'^y':
self.assertIsNone(re.search(p, s))
self.assertEqual(re.split(p, s), [s])