Skip to content

Commit 30d8043

Browse files
committed
Run test_suggestions_for_same_name for delattr too
1 parent 68ea8f1 commit 30d8043

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/test/test_traceback.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,6 +4136,13 @@ class A:
41364136
actual = self.get_suggestion(A(), 'bluch')
41374137
self.assertNotIn("blech", actual)
41384138

4139+
def test_suggestions_for_same_name(self):
4140+
class A:
4141+
def __dir__(self):
4142+
return ['blech']
4143+
actual = self.get_suggestion(A(), 'blech')
4144+
self.assertNotIn("Did you mean", actual)
4145+
41394146

41404147
class GetattrSuggestionTests(BaseSuggestionTests):
41414148
def test_suggestions_no_args(self):
@@ -4179,13 +4186,6 @@ def __getattr__(self, attr):
41794186
actual = self.get_suggestion(cls(), 'bluch')
41804187
self.assertIn("blech", actual)
41814188

4182-
def test_suggestions_for_same_name(self):
4183-
class A:
4184-
def __dir__(self):
4185-
return ['blech']
4186-
actual = self.get_suggestion(A(), 'blech')
4187-
self.assertNotIn("Did you mean", actual)
4188-
41894189

41904190
class DelattrSuggestionTests(BaseSuggestionTests):
41914191
attr_function = delattr

0 commit comments

Comments
 (0)