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 鈥淪ign up for GitHub鈥, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-28249: fix lineno location for empty DocTest instances
#30498
Conversation
Misc/NEWS.d/next/Library/2022-01-09-14-23-00.bpo-28249.4dzB80.rst
Outdated
Show resolved
Hide resolved
|
This PR is stale because it has been open for 30 days with no activity. |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
I rebased and resolved a conflict with |
鈥GH-30498) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: 艁ukasz Langa <lukasz@langa.pl> (cherry picked from commit 8db2b3b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
Sorry, @sobolevn and @ambv, I could not cleanly backport this to |
|
Sorry @sobolevn and @ambv, I had trouble checking out the |
|
GH-92978 is a backport of this pull request to the 3.11 branch. |
鈥ythonGH-30498) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: 艁ukasz Langa <lukasz@langa.pl> (cherry picked from commit 8db2b3b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
鈥ythonGH-30498) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: 艁ukasz Langa <lukasz@langa.pl> (cherry picked from commit 8db2b3b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
GH-92981 is a backport of this pull request to the 3.10 branch. |


This patch fixes
linenoforDocTestinstances for objects that don't have__doc__attribute.In the original issue this was used as an example:
Before this patch,
doctest.DocTestFinder(exclude_empty=False).find(example_module)was showing:Notice that
linenowas5forexampleandexample.a. Which is clearly wrong, becauseexample.bis on the 5th line. But,example.chadlineno=None.DocTestdocs clearly state:So, now
linenois set toNonewhen__doc__cannot be found. Now, the result for ourexamplemodule will be:Now, everything looks correct.
https://bugs.python.org/issue28249
CC @corona10 as my mentor馃檪