Skip to content
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

Support coverage arguments with the python setup.py coverage command. #83

Open
SharonGoliath opened this issue May 31, 2018 · 2 comments

Comments

@SharonGoliath
Copy link
Collaborator

As opposed to:

pytest caom2utils --cov --cov-report html
@yeunga
Copy link
Collaborator

yeunga commented Jun 7, 2018

python setup.py pytest --addopts '--cov --cov-report html'

works and generates coverage reports in html format. Similarly we can replace 'html' with 'xml' for xml formatted coverage reports. Modification to setup.py is not required, so we shall have a cleaner setup.py file by removing the coverage related statements.

We can also define an environment variable, e.g.

export PYTEST_ADDOPTS="--cov --cov-report.xml"
python setup.py pytest

However we need to find a place to define the environment variable.

@yeunga
Copy link
Collaborator

yeunga commented Jun 12, 2018

Updated setup.py based on Adrian's solution. The following commands works:

no coverage report to generate

python setup.py test
python setup.py intTest
python setup.py allTest

generates a coverage report

python setup.py test --cov --cov-report <type, e.g. html>
python setup.py intTest --cov --cov-report <type, e.g. xml>
python setup.py allTest --cov --cov-report <type, e.g. term>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants