bpo-45400: Fix suggestion test of test_exceptions (GH-28783)

Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals()
of test_exceptions if a directory name contains "a1" (like
"Python-3.11.0a1"): use a stricter regular expression.
This commit is contained in:
Victor Stinner 2021-10-07 13:47:23 +02:00 committed by GitHub
parent 3f2c433da5
commit 4e605666b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1840,7 +1840,7 @@ class NameErrorTests(unittest.TestCase):
with support.captured_stderr() as err:
sys.__excepthook__(*sys.exc_info())
self.assertNotIn("a1", err.getvalue())
self.assertNotRegex(err.getvalue(), r"NameError.*a1")
def test_name_error_with_custom_exceptions(self):
def f():

View File

@ -0,0 +1,3 @@
Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals() of
test_exceptions if a directory name contains "a1" (like "Python-3.11.0a1"):
use a stricter regular expression. Patch by Victor Stinner.