Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools to coverage tests Django Rest Framework

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.

like image 369
Jefferson Bruchado Avatar asked Feb 25 '26 18:02

Jefferson Bruchado


1 Answers

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.

like image 174
Gleb Sevruk Avatar answered Feb 27 '26 09:02

Gleb Sevruk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!