aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-07 13:47:23 +0200
committerMichał Górny <mgorny@gentoo.org>2021-10-30 08:34:55 +0200
commitef0d9f145eb5c3c07bd30682522c659fc37f92dc (patch)
tree45762ecd16b6abc8413f54580b85bdb7bf09db3a
parentbpo-45433: Do not link libpython against libcrypt (diff)
downloadcpython-ef0d9f145eb5c3c07bd30682522c659fc37f92dc.tar.gz
cpython-ef0d9f145eb5c3c07bd30682522c659fc37f92dc.tar.bz2
cpython-ef0d9f145eb5c3c07bd30682522c659fc37f92dc.zip
bpo-45400: Fix suggestion test of test_exceptions (GH-28783)gentoo-3.11.0a1
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.
-rw-r--r--Lib/test/test_exceptions.py2
-rw-r--r--Misc/NEWS.d/next/Tests/2021-10-07-13-11-45.bpo-45400.h3iT7V.rst3
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 70d10ebc66e..d8b658b0244 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():
diff --git a/Misc/NEWS.d/next/Tests/2021-10-07-13-11-45.bpo-45400.h3iT7V.rst b/Misc/NEWS.d/next/Tests/2021-10-07-13-11-45.bpo-45400.h3iT7V.rst
new file mode 100644
index 00000000000..61b6653320d
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2021-10-07-13-11-45.bpo-45400.h3iT7V.rst
@@ -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.