I built django project with many applications. Now I want to generate a coverage report for these applications. For testing purposes, I use py.test, pytest-django and pytest-cov. So far, I can generate the report only by typing all my app names manually on the command line:
py.test --cov-report html --cov=app1 --cov=app2 --cov=app3 --cov=app4 */tests.py
Does pytest-cov have a way to specify all the applications with a simple expression?
Assuming you're using bash, you could use it to expand the parameters:
py.test --cov-report html --cov=app{1,2,3,4} */tests.py
You could also add those parameters to pytest.ini so they're passed automatically on each invocation.
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