gh-107995: Fix doctest collection of functools.cached_property objects (#107996)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Tyler Smart 2023-08-18 08:44:38 -07:00 committed by GitHub
parent 28cab71f95
commit 9bb576cb07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 0 deletions

View file

@ -3105,6 +3105,9 @@ class TestCachedProperty(unittest.TestCase):
def test_doc(self):
self.assertEqual(CachedCostItem.cost.__doc__, "The cost of the item.")
def test_module(self):
self.assertEqual(CachedCostItem.cost.__module__, CachedCostItem.__module__)
def test_subclass_with___set__(self):
"""Caching still works for a subclass defining __set__."""
class readonly_cached_property(py_functools.cached_property):