How to run tests before the commit in Pycharm/Intellij Idea
If you don't want to buy a TeamCity licence, you can also use the "toggle auto-test" feature that re-runs your tests whenever you change them.
It does not block your commits but warns you when you have a failed test.