Open SharonGoliath opened 6 years ago
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.
Updated setup.py based on Adrian's solution. The following commands works:
python setup.py test python setup.py intTest python setup.py allTest
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>
As opposed to: