-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Error in doctest on namespace package with Python 3.7 #3276
Comments
Interestingly, I don't encounter the issue when running tests on |
Interesting - the tests are passing in Travis, so whatever is going on seems to be isolated to my environment. |
Also interesting - on my mac where the test is failing, the test also fails when testing jaraco.collections (which has a dependency on other jaraco.* packages) but not testing jaraco.classes (which does not). |
I just noticed the Travis build, although it's theoretically running a nightly build of Python, has Python 3.7.0a4+, while on my mac, I'm running 3.7.0b2. |
Uninstalling jaraco.classes from the environment before running the test bypasses the issue, so it is definitely related to having another package of the same namespace as the package under test present. Also, the issue seems only to affect pkg_resources-managed namespaces, as adding another 'backports' package to 'backports.unittest_mock' doesn't trigger the issue. |
I was able to replicate the issue without pytest, so it seems to be an upstream issue.
|
Thanks @jaraco for the detailed investigation. Should we report this upstream? |
Yes, I have, and meant to link back here. It's bpo-32991. |
Great, thanks! |
I see this has been fixed in |
Yes. |
There seems to be an emergent issue with pytest when running
--doctest-modules
on Python 3.7.Here's a run of
jaraco.functools
' tests:At the point where
inspect.getsourcefile(obj)
is called, obj is<module 'jaraco' (namespace)>
.Perhaps all that's needed to be done here is have pytest ignore collection on namespace packages.
The text was updated successfully, but these errors were encountered: