[Python-checkins] gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (#99895)

vstinner webhook-mailer at python.org
Thu Dec 1 08:06:03 EST 2022


https://github.com/python/cpython/commit/0563be23a557917228a8b48cbb31bda285a3a815
commit: 0563be23a557917228a8b48cbb31bda285a3a815
branch: main
author: Pablo Galindo Salgado <Pablogsal at gmail.com>
committer: vstinner <vstinner at python.org>
date: 2022-12-01T14:05:56+01:00
summary:

gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (#99895)

Co-authored-by: Victor Stinner <vstinner at python.org>

files:
M Lib/test/test_traceback.py

diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index c17bbb48b65b..95b1bae4f608 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -2978,9 +2978,9 @@ class MyClass:
         for name in ("b", "v", "m", "py"):
             with self.subTest(name=name):
                 actual = self.get_suggestion(MyClass, name)
-                self.assertNotIn("you mean", actual)
-                self.assertNotIn("vvv", actual)
-                self.assertNotIn("mom", actual)
+                self.assertNotIn("Did you mean", actual)
+                self.assertNotIn("'vvv", actual)
+                self.assertNotIn("'mom'", actual)
                 self.assertNotIn("'id'", actual)
                 self.assertNotIn("'w'", actual)
                 self.assertNotIn("'pytho'", actual)
@@ -3168,9 +3168,9 @@ def test_import_from_error_bad_suggestions_do_not_trigger_for_small_names(self):
         for name in ("b", "v", "m", "py"):
             with self.subTest(name=name):
                 actual = self.get_import_from_suggestion(code, name)
-                self.assertNotIn("you mean", actual)
-                self.assertNotIn("vvv", actual)
-                self.assertNotIn("mom", actual)
+                self.assertNotIn("Did you mean", actual)
+                self.assertNotIn("'vvv'", actual)
+                self.assertNotIn("'mom'", actual)
                 self.assertNotIn("'id'", actual)
                 self.assertNotIn("'w'", actual)
                 self.assertNotIn("'pytho'", actual)



More information about the Python-checkins mailing list