Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-81682: Fix test failures when CPython is built without docstrings #113410

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 22, 2023

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. I'm guessing you're on a spree of closing out old tickets? Don't let my comments distract you, this could be merge right now.

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__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR to change, but this seems a rather silly test -- it tests that the methods have certain text in their docstrings. I'm curious why that needs to be a test...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added in 5376ba9 (bpo-24400/#68588) which introduced a distinct type for 'async def' coroutines. I guess it was the simplest way to check that these methods and data descriptors belong to the coroutine type and not inherited from the generator type. It could check the __objclass__ attribute instead.

I am planning to add signatures for all builtins, so docstrings of coroutine methods will change in the nearest future (they may already be changed in my branch).

Lib/test/test_pydoc.py Outdated Show resolved Hide resolved
@brettcannon brettcannon removed their request for review December 22, 2023 21:02
@serhiy-storchaka
Copy link
Member Author

I'm guessing you're on a spree of closing out old tickets?

Kind of. I'm clearing my debts -- PRs that I was requested to review or was reviewed, but which for some reasons were not closed yet.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) December 23, 2023 09:46
@serhiy-storchaka serhiy-storchaka merged commit 4e5b27e into python:main Dec 23, 2023
27 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4e5b27e6a3be85853bd04d45128dd7cc706bb1c8 3.12

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4e5b27e6a3be85853bd04d45128dd7cc706bb1c8 3.11

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Dec 23, 2023
…t docstrings (pythonGH-113410)

(cherry picked from commit 4e5b27e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 23, 2023

GH-113429 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 23, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Dec 23, 2023
…t docstrings (pythonGH-113410)

(cherry picked from commit 4e5b27e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 23, 2023

GH-113430 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 23, 2023
serhiy-storchaka added a commit that referenced this pull request Dec 23, 2023
serhiy-storchaka added a commit that referenced this pull request Dec 23, 2023
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull request Dec 26, 2023
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants