[TIP] how to configure automated python testing and code coverage reports
jd5948 at att.com
Tue Dec 18 07:44:46 PST 2018
I am a python pytest newbie, and am trying to configure automated python testing and code coverage reports.
The source code folder structure is as follows:
I want to configure tox to
1) Execute all test-*.py scripts
2) Find all .py scripts, and calculate their test coverage
3) Eventually I also want to upload this coverage report to sonar
With below tox.ini:
1) All test_*.py scripts are found and executed
2) Coverage is only reported for the specific test_scriptA.py I list. If I omit the specific test, I get errors.
How can I configure 'coverage' to find all py files, and report on their coverage?
This is what I have so far in my tox.ini:
deps = pytest
coverage run subfolder/test_scriptA.py
coverage report -m
Thanks for any advice - Joe
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python