-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136438: Make sure test.test_pydoc.test_pydoc pass with all optimization levels #136479
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
base: main
Are you sure you want to change the base?
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@@ -1461,7 +1461,7 @@ def test_special_form(self): | |||
self.assertIn('NoReturn = typing.NoReturn', doc) | |||
self.assertIn(typing.NoReturn.__doc__.strip().splitlines()[0], doc) | |||
else: | |||
self.assertIn('NoReturn = class _SpecialForm(_Final)', doc) | |||
self.assertIn('NoReturn = class _SpecialForm(_Final, _NotIterable)', doc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter was added 3 years ago, and popped up now because -OO
optimizes away typing.NoReturn.__doc__
. I think we need a better solution here, since this is not properly tested.
cc @hauntsaninja who I see added this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add the test, I just fixed it up to accommodate another change. The test was added in #30253
Not sure that there's a good solution to be had really, maybe you have ideas! pydoc does depend on __doc__
... if we want to guarantee tests pass on -OO
we probably just have to run tests with -OO
Output before:
-OO
#136438