diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-04-17 22:28:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 22:28:45 (GMT) |
commit | 0b1c169c4a009e1094fe5df938d2367e63ebeea0 (patch) | |
tree | c76957f0ecef70034069d510eec79bcdd85d18f1 /Lib/test/test_exceptions.py | |
parent | 8bf274a5002c013dd4086f6390fa19452b63ac1d (diff) | |
download | cpython-0b1c169c4a009e1094fe5df938d2367e63ebeea0.zip cpython-0b1c169c4a009e1094fe5df938d2367e63ebeea0.tar.gz cpython-0b1c169c4a009e1094fe5df938d2367e63ebeea0.tar.bz2 |
bpo-38530: Cover more error paths in error suggestion functions (GH-25462)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index b730858..d1e1b19 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1741,6 +1741,16 @@ class AttributeErrorTests(unittest.TestCase): self.assertNotIn("blech", err.getvalue()) self.assertNotIn("oh no!", err.getvalue()) + def test_attribute_error_with_bad_name(self): + try: + raise AttributeError(name=12, obj=23) + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertNotIn("?", err.getvalue()) + + class ImportErrorTests(unittest.TestCase): def test_attributes(self): |