@@ -2696,7 +2696,10 @@ def static_func(arg: int) -> str:
26962696 A ().static_func
26972697 ):
26982698 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 ))
27002703 self .assertEqual (meth .__annotations__ ['arg' ], int )
27012704
27022705 self .assertEqual (A .func .__name__ , 'func' )
@@ -2785,7 +2788,10 @@ def decorated_classmethod(cls, arg: int) -> str:
27852788 WithSingleDispatch ().decorated_classmethod
27862789 ):
27872790 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 ))
27892795 self .assertEqual (meth .__annotations__ ['arg' ], int )
27902796
27912797 self .assertEqual (
@@ -3128,7 +3134,10 @@ def test_access_from_class(self):
31283134 self .assertIsInstance (CachedCostItem .cost , py_functools .cached_property )
31293135
31303136 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 ))
31323141
31333142 def test_module (self ):
31343143 self .assertEqual (CachedCostItem .cost .__module__ , CachedCostItem .__module__ )
0 commit comments