How to achieve coverage reports like Ruby-Rails in Django-Python with coverage.py?
-
07-07-2021 - |
Pregunta
We do coverage reports with the famous and possible the only solution in python
world i.e. coverage.py
Now,
What we acheive with coverage.py
is this :
Where as what we could achieve with ruby-rails
is :
So, my question is how do you get more detailed coverage reports with coverage.py
?
[ Or any other tool in the python django world ]
Note:
coverage run manage.py test --settings=project.test_settings
- Generate the report by
coverage html
- Should / Can I pass in extra parameters to
coverage
while generating report ?
Solución
1) A search box seems useful, no one has ever suggested it before!
2) Conditional coverage: coverage.py has a --branch switch that enables branch coverage, is this what you are looking for?
3) Hits/line: is this how many times each line was executed? I've never seen it aggregated like this. I don't understand how I would use that statistic in my own work. Can you help me understand why people want to know the averaged hits/line?