-
Notifications
You must be signed in to change notification settings - Fork 14
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
pytest-cov collection #28
Comments
What do you mean by this ? It runs all tests or it displays coverage for all tests ? I tried locally and there's indeed an issue when one wants to only run pytest on a single test. Example:
doesn't work: all tests are run. But this is not related to pytest-cov. I could fix it with the following pytest config (in setup.cfg):
Using an empty PYTEST_ADDOPTS variable is not a good solution, since it will also clear other options (--doctest-module, --pep8, etc). Also, having the global coverage when running a single test makes no sense and maybe the options related to coverage should be moved to the tests env in tox.ini. I tried that and it works well, will PR this, so you can try. |
@rienafairefr, see #29 |
OK. Looks fixed by #29 |
Because of the setup.cfg (the --cov=iotlabcli part in addopts), when running pytest it will always try to collect every test in the iotlabcli/ hierarchy, even if we try to force it to run only a single test (e.g. by doing pytest iotlabcli/test/[...])
I could only force it to not collect everything by having an empty PYTEST_ADDOPTS environment variable.
We could try to put the --cov parameters in a specific tox environement (tests-coverage) instead of the setup.cfg ?
The text was updated successfully, but these errors were encountered: