Replies: 2 comments 1 reply
|
Look at the sys.path difference when running Your test will fails when run with the cwd added your PATH, and passes without it. You could also see this by cd'ing to another directory before running |
0 replies
|
This can be reproduced without pytest by running, from the root of your repo:
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When I run
python -m pytestin my project, I get aModuleNotFoundErrorexception:But, when I run
pytest, the tests pass without any issue.Is this a known problem when pytest tries to import pybind11 module? Is there a way to make it work properly?
I made a small project to show you the problem: https://github.com/moi15moi/Coverage-bug-report
The documentation don't really mention any possible fix.
PS: Note that when I install the project with
pip install ., I have this issue. But, when I install the project withpip install --no-build-isolation --editable .(note that--no-build-isolationis needed because of this), I don't have it.All reactions