I am having shell script which calls multiple python code with argument. Now my requirement is to collect the report for the whole project. Any idea how to run coverage.py on whole code and generate a consolidated report. Below is a high level template of shell script which I am using. If anyone can guide how to achieve above requirements.
#!/bin/bash
variable=$1
/usr/bin/python python1.py $variable
something blah blah
/xyz/abc/python python2.py $someargument
For multiple python calls from a shell script use append option to append report after each python run.
#!/bin/bash
variable=$1
coverage run python1.py $variable
something blah blah
coverage run -a python2.py $someargument
To see the report
coverage report -m
Report:
Name Stmts Miss Cover Missing
----------------------------------------------
python1.py 97 1 99% 95
python2.py 1 0 100%
----------------------------------------------
TOTAL 98 1 99%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With