Closed keszybz closed 4 years ago
This is an issue that is common to all pytest
plugins I think: the plugin is only registered with pytest if it the package is installed. That is when its entry points are registered and the special pytest entry point is detected by pytest.
So there is not much I can do here. What did you try to do ?
EDIT: for development, I typically do pip install -e .
so that the package is installed in debug mode and I can continue to work on it without re-installing everytime I want to test.
Ideally, the test suite would be structured so that it is possible to run tests before installation, because it makes development and packaging easier... Dunno, maybe it should tweak some pytest config internally. But if this can't be solved, workarounds are easy enough.
(I'm trying to make a package for Fedora, and PYTHONPATH=%{buildroot}/%{python3_sitelib} %{__python3} -m pytest -v
works well enough.)
I agree with the "ideally" but that's how pytest seems to be working :)
Happy to see that the workarounds are working for you. I'll close the issue now, please do not hesitate to reopen if needed.
When I run
python3 -m pytest -v
from a git checkout, many tests fail with the same error:If I do
pip3 install --user .
, many of those tests start passing. It would be great if the tests could run before installation.