-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-133210: Fix test_pydoc
in --without-doc-strings
mode
#133271
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
Conversation
self.assertIn(' | __repr__(self, /) from builtins.object', lines) | ||
self.assertIn(' | object_repr = __repr__(self, /)', lines) | ||
else: | ||
self.assertIn(' | count(self, object, /) from builtins.list', lines) |
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.
We don't have CI building Python without docstrings, this code path is less well tested. Maybe just remove it and only keep tests when we have C docstrings?
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.
In this case we can have unexpected results when python is built without docstrings and no one will ever notice. Plus, this gives an example that you need to think about both modes when writting tests.
I don't think that signature of repr
, list.count
and list.get
without docstrings will change that often.
But, I don't have a strong opinion here for sure, I will make any change that you think is best here
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.
LGTM.
Ok, let's keep these tests without docstrings.
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…thonGH-133271) (cherry picked from commit 4912b29) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-133288 is a backport of this pull request to the 3.13 branch. |
Thank you! Working on other modules 👍 |
Tests now pass with
--without-doc-strings
and in a regular mode.--without-doc-strings
#133210