Skip to content

Commit f6b4c69

Browse files
committed
Add sobolevn's second arg as self test case
1 parent 266a87e commit f6b4c69

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_call.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ def method_one_arg_named_self(self):
978978
def method_one_arg_named_cls(cls):
979979
pass
980980

981+
def method_two_arg_second_param_self(arg1, self):
982+
pass
983+
981984

982985
class AMeta(type):
983986

@@ -1121,6 +1124,11 @@ def test_when_arg_named_cls_does_not_suggest(self):
11211124
A().method_one_arg_named_cls("arg1")
11221125
self.assertNotIn("Did you forget", str(cm.exception))
11231126

1127+
def test_when_second_param_is_self(self):
1128+
with self.assertRaises(TypeError) as cm:
1129+
A().method_two_arg_second_param_self()
1130+
self.assertNotIn("Did you forget", str(cm.exception))
1131+
11241132

11251133
@cpython_only
11261134
class TestErrorMessagesSuggestions(unittest.TestCase):

0 commit comments

Comments
 (0)