Skip to content
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

bpo-36406: Handle namespace packages in doctest #12520

Merged
merged 5 commits into from Dec 13, 2019

Conversation

@tirkarthi
Copy link
Contributor

tirkarthi commented Mar 24, 2019

Handle namespace packages in doctest where __file__ of empty package returns None

https://bugs.python.org/issue36406

@tirkarthi

This comment has been minimized.

Copy link
Contributor Author

tirkarthi commented Mar 26, 2019

Note to self and reviewer : I have originally added a fix to handle filename to None and finder is also documented to accept None. But the previous code seems to always default to module.__name__ where __file__ attribute was absent for empty packages previously. So I changed this to getattr(module, '__file__', module.__name__) or module.__name__ to remove check for filename to be None.

Lib/doctest.py Outdated Show resolved Hide resolved
@tirkarthi

This comment has been minimized.

Copy link
Contributor Author

tirkarthi commented May 1, 2019

Ping @warsaw for review. This was caused due to a23d30f where __file__ was set as None for empty packages causing doctest to fail for empty packages.

@csabella csabella requested review from warsaw and brettcannon May 29, 2019
Lib/doctest.py Outdated Show resolved Hide resolved
Co-Authored-By: Brett Cannon <54418+brettcannon@users.noreply.github.com>
@tirkarthi tirkarthi changed the title bpo-36406: Handle empty packages in doctest bpo-36406: Handle namespace packages in doctest Sep 11, 2019
@brettcannon brettcannon self-requested a review Sep 13, 2019
@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Nov 27, 2019

@warsaw anything to say before this gets merged?

@tirkarthi if Barry doesn't say anything in a week just ping me and I will merge this.

@tirkarthi

This comment has been minimized.

Copy link
Contributor Author

tirkarthi commented Dec 10, 2019

@brettcannon Ping for merge. Thanks.

@brettcannon brettcannon self-assigned this Dec 10, 2019
@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Dec 10, 2019

@tirkarthi thanks for the ping. I will merge this probably this week or next when I have the time.

@brettcannon brettcannon merged commit 8289e27 into python:master Dec 13, 2019
5 checks passed
5 checks passed
Azure Pipelines PR #20190911.63 succeeded
Details
bedevere/issue-number Issue number 36406 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Dec 13, 2019

Thanks @tirkarthi for the PR, and @brettcannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this pull request Dec 13, 2019
(cherry picked from commit 8289e27)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Dec 13, 2019

GH-17591 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit to miss-islington/cpython that referenced this pull request Dec 13, 2019
(cherry picked from commit 8289e27)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Dec 13, 2019

GH-17592 is a backport of this pull request to the 3.7 branch.

brettcannon added a commit that referenced this pull request Dec 13, 2019
(cherry picked from commit 8289e27)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
brettcannon added a commit that referenced this pull request Dec 13, 2019
(cherry picked from commit 8289e27)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
@tirkarthi

This comment has been minimized.

Copy link
Contributor Author

tirkarthi commented Dec 13, 2019

Thanks @brettcannon and @methane for review :)

sthagen added a commit to sthagen/cpython that referenced this pull request Dec 14, 2019
bpo-36406: Handle namespace packages in doctest (pythonGH-12520)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.