-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dir
Description
Currently test_search_anchor_at_beginning requires to be completed in an absolute time.
This can be flaky at low CPU environment or slow alternative implementation like RustPython.
I would like to suggest adding @support.requires_resource('cpu')
to the test.
Lines 2285 to 2296 in 62aeb0e
def test_search_anchor_at_beginning(self): | |
s = 'x'*10**7 | |
with CPUStopwatch() as stopwatch: | |
for p in r'\Ay', r'^y': | |
self.assertIsNone(re.search(p, s)) | |
self.assertEqual(re.split(p, s), [s]) | |
self.assertEqual(re.findall(p, s), []) | |
self.assertEqual(list(re.finditer(p, s)), []) | |
self.assertEqual(re.sub(p, '', s), s) | |
# Without optimization it takes 1 second on my computer. | |
# With optimization -- 0.0003 seconds. | |
self.assertLess(stopwatch.seconds, 0.1) |
Linked PRs
youknowone and Eclips4
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dir