@@ -2604,7 +2604,10 @@ def static_func(arg: int) -> str:
2604
2604
A ().static_func
2605
2605
):
2606
2606
with self .subTest (meth = meth ):
2607
- self .assertEqual (meth .__doc__ , 'My function docstring' )
2607
+ self .assertEqual (meth .__doc__ ,
2608
+ ('My function docstring'
2609
+ if support .HAVE_DOCSTRINGS
2610
+ else None ))
2608
2611
self .assertEqual (meth .__annotations__ ['arg' ], int )
2609
2612
2610
2613
self .assertEqual (A .func .__name__ , 'func' )
@@ -2693,7 +2696,10 @@ def decorated_classmethod(cls, arg: int) -> str:
2693
2696
WithSingleDispatch ().decorated_classmethod
2694
2697
):
2695
2698
with self .subTest (meth = meth ):
2696
- self .assertEqual (meth .__doc__ , 'My function docstring' )
2699
+ self .assertEqual (meth .__doc__ ,
2700
+ ('My function docstring'
2701
+ if support .HAVE_DOCSTRINGS
2702
+ else None ))
2697
2703
self .assertEqual (meth .__annotations__ ['arg' ], int )
2698
2704
2699
2705
self .assertEqual (
@@ -3057,7 +3063,10 @@ def test_access_from_class(self):
3057
3063
self .assertIsInstance (CachedCostItem .cost , py_functools .cached_property )
3058
3064
3059
3065
def test_doc (self ):
3060
- self .assertEqual (CachedCostItem .cost .__doc__ , "The cost of the item." )
3066
+ self .assertEqual (CachedCostItem .cost .__doc__ ,
3067
+ ("The cost of the item."
3068
+ if support .HAVE_DOCSTRINGS
3069
+ else None ))
3061
3070
3062
3071
3063
3072
if __name__ == '__main__' :
0 commit comments