@@ -2696,7 +2696,10 @@ def static_func(arg: int) -> str:
2696
2696
A ().static_func
2697
2697
):
2698
2698
with self .subTest (meth = meth ):
2699
- self .assertEqual (meth .__doc__ , 'My function docstring' )
2699
+ self .assertEqual (meth .__doc__ ,
2700
+ ('My function docstring'
2701
+ if support .HAVE_DOCSTRINGS
2702
+ else None ))
2700
2703
self .assertEqual (meth .__annotations__ ['arg' ], int )
2701
2704
2702
2705
self .assertEqual (A .func .__name__ , 'func' )
@@ -2785,7 +2788,10 @@ def decorated_classmethod(cls, arg: int) -> str:
2785
2788
WithSingleDispatch ().decorated_classmethod
2786
2789
):
2787
2790
with self .subTest (meth = meth ):
2788
- self .assertEqual (meth .__doc__ , 'My function docstring' )
2791
+ self .assertEqual (meth .__doc__ ,
2792
+ ('My function docstring'
2793
+ if support .HAVE_DOCSTRINGS
2794
+ else None ))
2789
2795
self .assertEqual (meth .__annotations__ ['arg' ], int )
2790
2796
2791
2797
self .assertEqual (
@@ -3128,7 +3134,10 @@ def test_access_from_class(self):
3128
3134
self .assertIsInstance (CachedCostItem .cost , py_functools .cached_property )
3129
3135
3130
3136
def test_doc (self ):
3131
- self .assertEqual (CachedCostItem .cost .__doc__ , "The cost of the item." )
3137
+ self .assertEqual (CachedCostItem .cost .__doc__ ,
3138
+ ("The cost of the item."
3139
+ if support .HAVE_DOCSTRINGS
3140
+ else None ))
3132
3141
3133
3142
def test_module (self ):
3134
3143
self .assertEqual (CachedCostItem .cost .__module__ , CachedCostItem .__module__ )
0 commit comments