How to run tests before the commit in Pycharm/Intellij Idea

intellij-idea, pre-commit-hook, pycharm

Solution

Consider using TeamCity:

- Pre-Tested Commit: No broken code in your version control

Note that it also provides integration with IntelliJ IDEA.

Problem

Is it possible to run a specified script before any commit in Pycharm/Intellij Idea? I want to make sure that tests are not broken. Thanks.

Original source