diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-10-07 12:11:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 12:11:38 (GMT) |
commit | d55bf81c4ee2dcdd5dfa3b5a9905a0b32ca8d38b (patch) | |
tree | ebd3fbbfa0145571492bfc4d6956fadd0ac45531 /Lib/test | |
parent | ee92205bb2b0c3693c5ed32d281d2d3bb40f6e4d (diff) | |
download | cpython-d55bf81c4ee2dcdd5dfa3b5a9905a0b32ca8d38b.zip cpython-d55bf81c4ee2dcdd5dfa3b5a9905a0b32ca8d38b.tar.gz cpython-d55bf81c4ee2dcdd5dfa3b5a9905a0b32ca8d38b.tar.bz2 |
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.
(cherry picked from commit 4e605666b08b8f863cbbbdaa34bb06988e648d26)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_exceptions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 82aa79e..143b856 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(): |