From 4e605666b08b8f863cbbbdaa34bb06988e648d26 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 7 Oct 2021 13:47:23 +0200 Subject: 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. --- Lib/test/test_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_exceptions.py') diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 289288478c2..85dc3c0f220 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -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(): -- cgit v1.2.3