-
Notifications
You must be signed in to change notification settings - Fork 20
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
spin test does not work with an editable install #185
Comments
I am not sure this is right. The tests work with the |
The repo I used for demonstration is this one: In the demo the tests are in-package but the package uses src-layout (unlike |
Ah, yes, that would explain it. Curious why |
I think that for in-package tests If you are using |
Yeah, so it needs to find the test files in the It sounds like we may need a setting to determine where pytest should search for tests: |
Why can't it find the test files from the editable install? |
The reason that I ask this is because if the in-package tests are found via sys.path then there is no need to distinguish between a src vs non-src layout: if the module is importable then so are its tests. There is then no need to provide configuration options for the different schemes because it is already taken care of. There is however a need to distinguish between in-package vs out-of-package tests. The out-of-package tests always need to be picked up by file system path rather than Python's import paths. |
I was referring to out-of-package tests, or tests that are not installed alongside the package (which is not that atypical). |
So which one does skimage use? It looks to me like it has in-package tests that are installed: |
Yes, AFAIK we do install the tests, but for me |
Maybe that is something that needs to be fixed in pytest. What happens with:
|
Only the last command manages to find any tests. |
If I try this: pip install sympy pytest hypothesis
pytest --pyargs sympy then as far as I can tell that recursively finds all tests in all |
Yes, that works for me too. |
Can you make sure you are using meson-python latest release i.e. 0.16 to build? This may partially be related to a collection issue with |
After |
Latest meson-python seems to have done the trick for me! |
Glad to hear, it was a bit of a wild guess but it worked 🎉 |
Also do not switch out of source path when running tests. - Allow testing src/ layout tests - Better support editable install tests See scientific-python#185
Also do not switch out of source path when running tests. - Allow testing src/ layout tests - Better support editable install tests See #185
This should be closed by #191 |
I just tested and it seems to work. |
Thanks! |
This may have caused a regression on Windows (#203), so I'll need to figure out what to do on that platform. |
After an editable install
spin install
runningspin test
fails:It is trying to run
pytest stuff
when the command should bepytest --pyargs stuff
:The text was updated successfully, but these errors were encountered: