summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_exceptions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 2b00147..31051d4 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1916,6 +1916,18 @@ class AttributeErrorTests(unittest.TestCase):
self.assertIn("blech", err.getvalue())
+ def test_getattr_suggestions_for_same_name(self):
+ class A:
+ def __dir__(self):
+ return ['blech']
+ try:
+ A().blech
+ except AttributeError as exc:
+ with support.captured_stderr() as err:
+ sys.__excepthook__(*sys.exc_info())
+
+ self.assertNotIn("Did you mean", err.getvalue())
+
def test_attribute_error_with_failing_dict(self):
class T:
bluch = 1