@@ -3412,9 +3412,10 @@ def m1d(*args, **kwargs):
3412
3412
int ))
3413
3413
3414
3414
def test_signature_on_classmethod (self ):
3415
- self .assertEqual (self .signature (classmethod ),
3416
- ((('function' , ..., ..., "positional_only" ),),
3417
- ...))
3415
+ if not support .MISSING_C_DOCSTRINGS :
3416
+ self .assertEqual (self .signature (classmethod ),
3417
+ ((('function' , ..., ..., "positional_only" ),),
3418
+ ...))
3418
3419
3419
3420
class Test :
3420
3421
@classmethod
@@ -3434,9 +3435,10 @@ def foo(cls, arg1, *, arg2=1):
3434
3435
...))
3435
3436
3436
3437
def test_signature_on_staticmethod (self ):
3437
- self .assertEqual (self .signature (staticmethod ),
3438
- ((('function' , ..., ..., "positional_only" ),),
3439
- ...))
3438
+ if not support .MISSING_C_DOCSTRINGS :
3439
+ self .assertEqual (self .signature (staticmethod ),
3440
+ ((('function' , ..., ..., "positional_only" ),),
3441
+ ...))
3440
3442
3441
3443
class Test :
3442
3444
@staticmethod
@@ -3954,9 +3956,10 @@ def __init__(self, b):
3954
3956
3955
3957
self .assertEqual (C (3 ), 8 )
3956
3958
self .assertEqual (C (3 , 7 ), 1 )
3957
- # BUG: Returns '<Signature (b)>'
3958
- with self .assertRaises (AssertionError ):
3959
- self .assertEqual (self .signature (C ), self .signature ((0 ).__pow__ ))
3959
+ if not support .MISSING_C_DOCSTRINGS :
3960
+ # BUG: Returns '<Signature (b)>'
3961
+ with self .assertRaises (AssertionError ):
3962
+ self .assertEqual (self .signature (C ), self .signature ((0 ).__pow__ ))
3960
3963
3961
3964
class CM (type ):
3962
3965
def __new__ (mcls , name , bases , dct , * , foo = 1 ):
@@ -4352,7 +4355,8 @@ class C:
4352
4355
__call__ = (2 ).__pow__
4353
4356
4354
4357
self .assertEqual (C ()(3 ), 8 )
4355
- self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4358
+ if not support .MISSING_C_DOCSTRINGS :
4359
+ self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4356
4360
4357
4361
with self .subTest ('ClassMethodDescriptorType' ):
4358
4362
class C (dict ):
@@ -4361,7 +4365,8 @@ class C(dict):
4361
4365
res = C ()([1 , 2 ], 3 )
4362
4366
self .assertEqual (res , {1 : 3 , 2 : 3 })
4363
4367
self .assertEqual (type (res ), C )
4364
- self .assertEqual (self .signature (C ()), self .signature (dict .fromkeys ))
4368
+ if not support .MISSING_C_DOCSTRINGS :
4369
+ self .assertEqual (self .signature (C ()), self .signature (dict .fromkeys ))
4365
4370
4366
4371
with self .subTest ('MethodDescriptorType' ):
4367
4372
class C (str ):
@@ -4375,7 +4380,8 @@ class C(int):
4375
4380
__call__ = int .__pow__
4376
4381
4377
4382
self .assertEqual (C (2 )(3 ), 8 )
4378
- self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4383
+ if not support .MISSING_C_DOCSTRINGS :
4384
+ self .assertEqual (self .signature (C ()), self .signature ((0 ).__pow__ ))
4379
4385
4380
4386
with self .subTest ('MemberDescriptorType' ):
4381
4387
class C :
@@ -4393,7 +4399,8 @@ class C:
4393
4399
def __call__ (self , * args , ** kwargs ):
4394
4400
pass
4395
4401
4396
- self .assertEqual (self .signature (C ), ((), ...))
4402
+ if not support .MISSING_C_DOCSTRINGS :
4403
+ self .assertEqual (self .signature (C ), ((), ...))
4397
4404
self .assertEqual (self .signature (C ()),
4398
4405
((('a' , ..., ..., "positional_only" ),
4399
4406
('b' , ..., ..., "positional_or_keyword" ),
0 commit comments