@@ -3602,9 +3602,10 @@ def m1d(*args, **kwargs):
3602
3602
int ))
3603
3603
3604
3604
def test_signature_on_classmethod (self ):
3605
- self .assertEqual (self .signature (classmethod ),
3606
- ((('function' , ..., ..., "positional_only" ),),
3607
- ...))
3605
+ if not support .MISSING_C_DOCSTRINGS :
3606
+ self .assertEqual (self .signature (classmethod ),
3607
+ ((('function' , ..., ..., "positional_only" ),),
3608
+ ...))
3608
3609
3609
3610
class Test :
3610
3611
@classmethod
@@ -3624,9 +3625,10 @@ def foo(cls, arg1, *, arg2=1):
3624
3625
...))
3625
3626
3626
3627
def test_signature_on_staticmethod (self ):
3627
- self .assertEqual (self .signature (staticmethod ),
3628
- ((('function' , ..., ..., "positional_only" ),),
3629
- ...))
3628
+ if not support .MISSING_C_DOCSTRINGS :
3629
+ self .assertEqual (self .signature (staticmethod ),
3630
+ ((('function' , ..., ..., "positional_only" ),),
3631
+ ...))
3630
3632
3631
3633
class Test :
3632
3634
@staticmethod
@@ -4076,9 +4078,10 @@ def __init__(self, b):
4076
4078
4077
4079
self .assertEqual (C (3 ), 8 )
4078
4080
self .assertEqual (C (3 , 7 ), 1 )
4079
- # BUG: Returns '<Signature (b)>'
4080
- with self .assertRaises (AssertionError ):
4081
- self .assertEqual (self .signature (C ), self .signature ((0 ).__pow__ ))
4081
+ if not support .MISSING_C_DOCSTRINGS :
4082
+ # BUG: Returns '<Signature (b)>'
4083
+ with self .assertRaises (AssertionError ):
4084
+ self .assertEqual (self .signature (C ), self .signature ((0 ).__pow__ ))
4082
4085
4083
4086
class CM (type ):
4084
4087
def __new__ (mcls , name , bases , dct , * , foo = 1 ):
@@ -4478,7 +4481,8 @@ class C:
4478
4481
__call__ = (2 ).__pow__
4479
4482
4480
4483
self .assertEqual (C ()(3 ), 8 )
4481
- self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4484
+ if not support .MISSING_C_DOCSTRINGS :
4485
+ self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4482
4486
4483
4487
with self .subTest ('ClassMethodDescriptorType' ):
4484
4488
class C (dict ):
@@ -4487,7 +4491,8 @@ class C(dict):
4487
4491
res = C ()([1 , 2 ], 3 )
4488
4492
self .assertEqual (res , {1 : 3 , 2 : 3 })
4489
4493
self .assertEqual (type (res ), C )
4490
- self .assertEqual (self .signature (C ()), self .signature (dict .fromkeys ))
4494
+ if not support .MISSING_C_DOCSTRINGS :
4495
+ self .assertEqual (self .signature (C ()), self .signature (dict .fromkeys ))
4491
4496
4492
4497
with self .subTest ('MethodDescriptorType' ):
4493
4498
class C (str ):
@@ -4501,7 +4506,8 @@ class C(int):
4501
4506
__call__ = int .__pow__
4502
4507
4503
4508
self .assertEqual (C (2 )(3 ), 8 )
4504
- self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4509
+ if not support .MISSING_C_DOCSTRINGS :
4510
+ self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4505
4511
4506
4512
with self .subTest ('MemberDescriptorType' ):
4507
4513
class C :
@@ -4519,7 +4525,8 @@ class C:
4519
4525
def __call__ (self , * args , ** kwargs ):
4520
4526
pass
4521
4527
4522
- self .assertEqual (self .signature (C ), ((), ...))
4528
+ if not support .MISSING_C_DOCSTRINGS :
4529
+ self .assertEqual (self .signature (C ), ((), ...))
4523
4530
self .assertEqual (self .signature (C ()),
4524
4531
((('a' , ..., ..., "positional_only" ),
4525
4532
('b' , ..., ..., "positional_or_keyword" ),
0 commit comments