New GitHub issue #115264 from sobolevn:<br>

<hr>

<pre>
# Bug report

Output:

```
======================================================================
FAIL: test_doc (test.test_functools.TestCachedProperty.test_doc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 3126, in test_doc
    self.assertEqual(CachedCostItem.cost.__doc__, "The cost of the item.")
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'The cost of the item.'

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.cls_context_manager at 0x105c34a10>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2798, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.cls_context_manager at 0x105ced0d0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2798, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.decorated_classmethod at 0x105ced250>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2798, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.decorated_classmethod at 0x105ced310>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2798, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.func at 0x105c36d50>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.func at 0x105c36b10>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.cls_func at 0x105c36510>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.cls_func at 0x105c365d0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.static_func at 0x105c368d0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.static_func at 0x105c37d10>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_functools.py", line 2709, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__, 'My function docstring')
 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'My function docstring'

----------------------------------------------------------------------
Ran 262 tests in 0.124s

FAILED (failures=11, skipped=4)
test test_functools failed
test_functools failed (11 failures)

== Tests result: FAILURE ==

1 test failed:
    test_functools

Total duration: 229 ms
Total tests: run=262 failures=11 skipped=4
Total test files: run=1/1 failed=1
Result: FAILURE
```

I have a PR ready.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/115264">View on GitHub</a>
<p>Labels: type-bug, tests</p>
<p>Assignee: sobolevn</p>