[3.11] gh-81682: Fix test failures when CPython is built without docstrings (GH-113410) (GH-113430)

(cherry picked from commit 4e5b27e6a3)
This commit is contained in:
Serhiy Storchaka 2023-12-23 13:38:07 +02:00 committed by GitHub
parent 80b2bad2c2
commit fe2b4dd3c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 39 additions and 16 deletions

View file

@ -946,11 +946,12 @@ class CoroutineTest(unittest.TestCase):
def test_corotype_1(self):
ct = types.CoroutineType
self.assertIn('into coroutine', ct.send.__doc__)
self.assertIn('inside coroutine', ct.close.__doc__)
self.assertIn('in coroutine', ct.throw.__doc__)
self.assertIn('of the coroutine', ct.__dict__['__name__'].__doc__)
self.assertIn('of the coroutine', ct.__dict__['__qualname__'].__doc__)
if not support.MISSING_C_DOCSTRINGS:
self.assertIn('into coroutine', ct.send.__doc__)
self.assertIn('inside coroutine', ct.close.__doc__)
self.assertIn('in coroutine', ct.throw.__doc__)
self.assertIn('of the coroutine', ct.__dict__['__name__'].__doc__)
self.assertIn('of the coroutine', ct.__dict__['__qualname__'].__doc__)
self.assertEqual(ct.__name__, 'coroutine')
async def f(): pass