mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-38530: Cover more error paths in error suggestion functions (GH-25462)
This commit is contained in:
parent
8bf274a500
commit
0b1c169c4a
2 changed files with 15 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue