3

I am studying TDD and developing an API in Django Rest Framework, and I had a need that I researched and could not find some tools to solve my problem, I am trying to find out how much my tests cover my application in %.

For know the number of possibilities and possible suggestions of what is missing cover, I found the coverage lib, but it generates a report with lots of data, which are not very useful for my case, I just want to know the coverage of my tests that I created. Does anyone know of any tool or plugin for pycharm that does this coverage of the tests?

I know that in visual studio there is Ncrunch that does this, but I do not know if there is something similar in pycharm.

Jefferson Bruchado
  • 888
  • 2
  • 14
  • 33

2 Answers2

1

I was struggling with the same question.

Especially I wanted to visualize the execution path of each test and run only affected tests.

I created a tool that sits in the background and runs only impacted tests: (You will need PyCharm plugin and pycrunch-engine from pip)

https://pycrunch.com

https://github.com/gleb-sevruk/pycrunch-engine

This is how it looks like: tests hit line 33

tests hit another line

enter image description here

It is currently in beta, and may not support all usage scenarios, but I use it every day for development, without major issues.

Gleb Sevruk
  • 494
  • 5
  • 9
0

I found a tool in the professional pycharm of which does what I need, is the functionality of running the tests with coverage, there is an option that runs the tests again to check if everything is ok:

enter image description here

And in this tool there is also another feature that shows the coverage of your tests against the existing code:

enter image description here

I hope I can help someone who has the same doubt! Thanks!

Jefferson Bruchado
  • 888
  • 2
  • 14
  • 33