PyCrunch - Intelligent test execution and visual code coverage in the IDE

About 3 years ago I switched from C # development to Python. For two and a half years I tried to find a tool that would be similar to NCrunch in terms of convenience in daily work.



At some point, I scored on unit testing, and wrote code, running tests on CI.



But the idea did not leave my head. I wanted to create a tool that would greatly simplify development using tests, while recommending it to colleagues and friends.



Six months of development, and active use on our own projects, causes a desire to show the product to the community.



โ€œWhy do I need this?โ€:



1. Automatically run only those tests that are affected by code changes. (Startup occurs in the background, and does not distract from writing code)



2. Understanding which specific tests affect a particular line of code (Itโ€™s convenient, for example, to track the programโ€™s execution path and understand which code branches are not covered by tests yet):







3. Red rags markers visualize problematic lines of code that require special attention:







Technically, the project consists of two parts: an engine and a PyCharm plugin that communicate with each other via web sockets. All logic is in the engine, the plugin only draws the internal state of the engine. (There is still the third part - the `front` folder on the github , I used it myself while writing the plugin for the IDE)



Download the beta version, and try in our projects. Do not forget to read the instructions for launching a specific framework (PyTest and Django are currently supported)



Caution: Django tests, for the sake of speeding up work and parallel execution, run on the same database as `manage.py runserver`. Detailed reasons for this decision, and workarounds can be found on the github.



Entire demo:






All Articles