I have .coverage
files indicating code coverage of my Django project produced by coverage.py:
coverage run --branch --source='.' manage.py test style
I can produce nice HTML reports with coverage html
, but I'd really prefer to take advantage of IDEA's coverage view to indicate coverage in my project while I work on it.
I can't use IntelliJ's "Run with Coverage" command to generate the coverage data in the standard way. (Please take this for granted; I may ask a second question later about my reasons why.)
Is there any way I can import the .coverage
files produces by coverage.py into IntelliJ IDEA?
View code coverage results Run the desired class with coverage, select suite to show, and open class in the editor. From the main menu, select Run | Show Code Coverage. Press Ctrl+Alt+F6 .
If the plugin is disabled, the code coverage tabs will not be visible in the run/debug configuration dialogs. Try opening Settings > Build, Execution, Deployment > Coverage and check the "Activate Coverage View" checkbox. After that run another test with Coverage.
This is possible, at least as long as you run coverage
in the root directory of your project.
First you need convert the .coverage
file to coverage.xml
by running coverage xml
. Then it's just a matter of going to the Analyze menu, selecting "Show Code Coverage Data" and adding the XML file.
Thanks, and now with pycharm 2.7 you should go to Tools -> Show Code Coverage Data and add new File
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