-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-61648: Detect line numbers of properties in doctests #113161
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
Conversation
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 <[email protected]>
…GH-113161) (cherry picked from commit 8f8f0f9) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-113165 is a backport of this pull request to the 3.11 branch. |
…3161) (GH-113165) (cherry picked from commit 8f8f0f9) Co-authored-by: Serhiy Storchaka <[email protected]>
…3161) (GH-113164) (cherry picked from commit 8f8f0f9) Co-authored-by: Serhiy Storchaka <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.