Skip to content

Commit 85201c3

Browse files
Keep tests analogous to test_signatures
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 30a5245 commit 85201c3

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

Lib/test/test_functools.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,44 +3448,39 @@ def _(item: int, arg: bytes) -> str:
34483448

34493449
def test_method_signatures(self):
34503450
class A:
3451-
def m(self, item: int, arg) -> str:
3452-
return str(item)
3453-
@classmethod
3454-
def cm(cls, item: int, arg) -> str:
3455-
return str(item)
34563451
@functools.singledispatchmethod
3457-
def func(self, item: int, arg) -> str:
3452+
def func(self, item, arg: int) -> str:
34583453
return str(item)
34593454
@func.register
3460-
def _(self, item: bytes, arg) -> str:
3455+
def _(self, item: int, arg: bytes) -> str:
34613456
return str(item)
34623457

34633458
@functools.singledispatchmethod
34643459
@classmethod
3465-
def cls_func(cls, item: int, arg) -> str:
3460+
def cls_func(cls, item, arg: int) -> str:
34663461
return str(arg)
34673462
@func.register
34683463
@classmethod
3469-
def _(cls, item: bytes, arg) -> str:
3464+
def _(cls, item: int, arg: bytes) -> str:
34703465
return str(item)
34713466

34723467
@functools.singledispatchmethod
34733468
@staticmethod
3474-
def static_func(item: int, arg) -> str:
3469+
def static_func(item, arg: int) -> str:
34753470
return str(arg)
34763471
@func.register
34773472
@staticmethod
3478-
def _(item: bytes, arg) -> str:
3473+
def _(item: int, arg: bytes) -> str:
34793474
return str(item)
34803475

34813476
self.assertEqual(str(Signature.from_callable(A.func)),
3482-
'(self, item: int, arg) -> str')
3477+
'(self, item, arg: int) -> str')
34833478
self.assertEqual(str(Signature.from_callable(A().func)),
3484-
'(self, item: int, arg) -> str')
3479+
'(self, item, arg: int) -> str')
34853480
self.assertEqual(str(Signature.from_callable(A.cls_func)),
3486-
'(cls, item: int, arg) -> str')
3481+
'(cls, item, arg: int) -> str')
34873482
self.assertEqual(str(Signature.from_callable(A.static_func)),
3488-
'(item: int, arg) -> str')
3483+
'(item, arg: int) -> str')
34893484

34903485
def test_method_non_descriptor(self):
34913486
class Callable:

0 commit comments

Comments
 (0)