diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-04-19 22:35:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-19 22:35:53 (GMT) |
commit | 7a041162468b83f6cad667b78ed5c786286aed2b (patch) | |
tree | ed9e0d1622622b1c37940d312de7d6e679bc8db2 /Lib | |
parent | 4f9ffa8f9c7c31ad9480dfe99e84089017127ec9 (diff) | |
download | cpython-7a041162468b83f6cad667b78ed5c786286aed2b.zip cpython-7a041162468b83f6cad667b78ed5c786286aed2b.tar.gz cpython-7a041162468b83f6cad667b78ed5c786286aed2b.tar.bz2 |
bpo-25460: Surround suggestions by quotes (GH-25473)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_exceptions.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index d1e1b19..d93b0f16 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1453,12 +1453,12 @@ class NameErrorTests(unittest.TestCase): bluc = None print(bluch) - for func, suggestion in [(Substitution, "blech?"), - (Elimination, "blch?"), - (Addition, "bluchin?"), - (EliminationOverAddition, "blucha?"), - (SubstitutionOverElimination, "blach?"), - (SubstitutionOverAddition, "blach?")]: + for func, suggestion in [(Substitution, "'blech'?"), + (Elimination, "'blch'?"), + (Addition, "'bluchin'?"), + (EliminationOverAddition, "'blucha'?"), + (SubstitutionOverElimination, "'blach'?"), + (SubstitutionOverAddition, "'blach'?")]: err = None try: func() @@ -1475,7 +1475,7 @@ class NameErrorTests(unittest.TestCase): except NameError as exc: with support.captured_stderr() as err: sys.__excepthook__(*sys.exc_info()) - self.assertIn("global_for_suggestions?", err.getvalue()) + self.assertIn("'global_for_suggestions'?", err.getvalue()) def test_name_error_suggestions_from_builtins(self): def func(): @@ -1485,7 +1485,7 @@ class NameErrorTests(unittest.TestCase): except NameError as exc: with support.captured_stderr() as err: sys.__excepthook__(*sys.exc_info()) - self.assertIn("AttributeError?", err.getvalue()) + self.assertIn("'AttributeError'?", err.getvalue()) def test_name_error_suggestions_do_not_trigger_for_long_names(self): def f(): @@ -1628,12 +1628,12 @@ class AttributeErrorTests(unittest.TestCase): blucha = None bluc = None - for cls, suggestion in [(Substitution, "blech?"), - (Elimination, "blch?"), - (Addition, "bluchin?"), - (EliminationOverAddition, "bluc?"), - (SubstitutionOverElimination, "blach?"), - (SubstitutionOverAddition, "blach?")]: + for cls, suggestion in [(Substitution, "'blech'?"), + (Elimination, "'blch'?"), + (Addition, "'bluchin'?"), + (EliminationOverAddition, "'bluc'?"), + (SubstitutionOverElimination, "'blach'?"), + (SubstitutionOverAddition, "'blach'?")]: try: cls().bluch except AttributeError as exc: |