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

reporting coverage for a module imported with importlib #677

Open
martibosch opened this issue Feb 13, 2025 · 1 comment
Open

reporting coverage for a module imported with importlib #677

martibosch opened this issue Feb 13, 2025 · 1 comment

Comments

@martibosch
Copy link

Summary

I am using pytest with "importlib" as import mode because I am building a cython extension and otherwise pytest imports from the folder named "pylandstats" (without the built cython extension) rather than the installed package (also named "pylandstats", with the built cython extension).

How can I get coverage to be reported within this setup? Of course an alternative would be to move my module to src/pylandstats and not use the importlib import mode, but can this be solved otherwise?

This may be related to nedbat/coveragepy#1002

Thank you!

@ionelmc
Copy link
Member

ionelmc commented Feb 13, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants