-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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-61648: Detect line numbers of properties in doctests #113161
gh-61648: Detect line numbers of properties in doctests #113161
Conversation
serhiy-storchaka
commented
Dec 15, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: doctest test finder doesnt find line numbers of properties #61648
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. Two thoughts, both of which are beyond the scope of this PR:
- It's a shame
doctest
doesn't have more generalised support for other kinds of descriptors;functools.cached_property
doctests will still not have line numbers, for example. But it is much harder to do without changingdoctest
's whole approach, I know. - I'm curious if the
_find_lineno
function correctly handles wrapped functions (e.g. those returned fromfunctools.wraps
). Even if it works correctly now, it would be good to add tests for this. But again, it is a separate issue that should be tackled separately.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
GH-113164 is a backport of this pull request to the 3.12 branch. |
…GH-113161) (cherry picked from commit 8f8f0f9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…GH-113161) (cherry picked from commit 8f8f0f9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-113165 is a backport of this pull request to the 3.11 branch. |