https://github.com/python/cpython/commit/7e8578ce9df1d2bea26a5c6df08bbb58c92c9da5 commit: 7e8578ce9df1d2bea26a5c6df08bbb58c92c9da5 branch: 3.11 author: Miss Islington (bot) <[email protected]> committer: sobolevn <[email protected]> date: 2024-03-13T07:05:41Z summary:
[3.11] gh-115264: Fix `test_functools` with `-00` mode (GH-115276) (#116706) gh-115264: Fix `test_functools` with `-00` mode (GH-115276) (cherry picked from commit 27df81d5643f32be6ae84a00c5cf84b58e849b21) Co-authored-by: Nikita Sobolev <[email protected]> files: M Lib/test/test_functools.py diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index fb6e1860ac11fe..ee153458069796 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -2604,7 +2604,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') @@ -2693,7 +2696,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( @@ -3057,7 +3063,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)) if __name__ == '__main__': _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
