-
-
Notifications
You must be signed in to change notification settings - Fork 448
Coverage breaks with implicit namespaces #456
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
Comments
Original comment by Arcadiy Ivanov (Bitbucket: arcivanov, GitHub: arcivanov) Also fixed this in pybuilder pybuilder/pybuilder#301 |
@arcivanov Thanks for this. I have no experience with namespace packages. The test in the GitHub pull request uses a generated module. Can you provide a way to create an actual namespace package to test against? I'd feel better if it were as real as possible. |
Original comment by RobertR (Bitbucket: rbtcollins, GitHub: rbtcollins) What symptoms occur when using coverage with a project using implicit namespaces? |
Original comment by Arcadiy Ivanov (Bitbucket: arcivanov, GitHub: arcivanov) @rbtcollins the stacktrace you see similar to above. |
Original comment by Arcadiy Ivanov (Bitbucket: arcivanov, GitHub: arcivanov) @nedbat I'll just quote the PEP-0420 here if you don't mind:
The latter is the root cause of the problem if namespace is submitted as a module to be inspected/analyzed. |
Thanks for the pointer to the PEP, I hadn't realized Python 3.3 included this change. I tried this scenario with no problem:
If you could provide more details about exactly what you are trying that is failing, I would appreciate it. |
Original comment by Arcadiy Ivanov (Bitbucket: arcivanov, GitHub: arcivanov) Here's the specific scenario I'm targeting (pybuilder):
When you enumerate modules from the file system, unless you implement the above protocol exactly you don't know if a module is a namespace or a package or a module-proper. And if namespace is supplied directly, there is a blowout on coverage side. Please see the workaround in PyBuilder: pybuilder/pybuilder#302 |
Fixed in changeset 36bbed8ad2e5 (bb) |
Originally reported by Arcadiy Ivanov (Bitbucket: arcivanov, GitHub: arcivanov)
Under PEP-0420 there are implicit namespaces.
This happens when coverage instruments "namespace.package.module"
The text was updated successfully, but these errors were encountered: