mirror of
https://github.com/python/cpython
synced 2024-09-05 00:05:39 +00:00
gh-115264: Fix test_functools
with -00
mode (#115276)
This commit is contained in:
parent
43986f5567
commit
27df81d564
|
@ -2696,7 +2696,10 @@ def static_func(arg: int) -> str:
|
|||
A().static_func
|
||||
):
|
||||
with self.subTest(meth=meth):
|
||||
self.assertEqual(meth.__doc__, 'My function docstring')
|
||||
self.assertEqual(meth.__doc__,
|
||||
('My function docstring'
|
||||
if support.HAVE_DOCSTRINGS
|
||||
else None))
|
||||
self.assertEqual(meth.__annotations__['arg'], int)
|
||||
|
||||
self.assertEqual(A.func.__name__, 'func')
|
||||
|
@ -2785,7 +2788,10 @@ def decorated_classmethod(cls, arg: int) -> str:
|
|||
WithSingleDispatch().decorated_classmethod
|
||||
):
|
||||
with self.subTest(meth=meth):
|
||||
self.assertEqual(meth.__doc__, 'My function docstring')
|
||||
self.assertEqual(meth.__doc__,
|
||||
('My function docstring'
|
||||
if support.HAVE_DOCSTRINGS
|
||||
else None))
|
||||
self.assertEqual(meth.__annotations__['arg'], int)
|
||||
|
||||
self.assertEqual(
|
||||
|
@ -3128,7 +3134,10 @@ def test_access_from_class(self):
|
|||
self.assertIsInstance(CachedCostItem.cost, py_functools.cached_property)
|
||||
|
||||
def test_doc(self):
|
||||
self.assertEqual(CachedCostItem.cost.__doc__, "The cost of the item.")
|
||||
self.assertEqual(CachedCostItem.cost.__doc__,
|
||||
("The cost of the item."
|
||||
if support.HAVE_DOCSTRINGS
|
||||
else None))
|
||||
|
||||
def test_module(self):
|
||||
self.assertEqual(CachedCostItem.cost.__module__, CachedCostItem.__module__)
|
||||
|
|
Loading…
Reference in a new issue