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 |
Beta Was this translation helpful? Give feedback.
-
This can be reproduced without pytest by running, from the root of your repo:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When I run
python -m pytest
in my project, I get aModuleNotFoundError
exception: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-isolation
is needed because of this), I don't have it.Beta Was this translation helpful? Give feedback.
All reactions