@@ -2604,7 +2604,10 @@ def static_func(arg: int) -> str:
26042604 A ().static_func
26052605 ):
26062606 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 ))
26082611 self .assertEqual (meth .__annotations__ ['arg' ], int )
26092612
26102613 self .assertEqual (A .func .__name__ , 'func' )
@@ -2693,7 +2696,10 @@ def decorated_classmethod(cls, arg: int) -> str:
26932696 WithSingleDispatch ().decorated_classmethod
26942697 ):
26952698 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 ))
26972703 self .assertEqual (meth .__annotations__ ['arg' ], int )
26982704
26992705 self .assertEqual (
@@ -3057,7 +3063,10 @@ def test_access_from_class(self):
30573063 self .assertIsInstance (CachedCostItem .cost , py_functools .cached_property )
30583064
30593065 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 ))
30613070
30623071
30633072if __name__ == '__main__' :
0 commit comments