Is it possible to run the specified script before any commit in Pycharm / Intellij Idea? I want to make sure that the tests are not broken. Thanks.
Consider using TeamCity :
Please note that it also provides integration with IntelliJ IDEA.
If you do not want to buy a TeamCity license, you can also use the "toggle auto-test" function, it runs your tests when you change them.
It does not block your commits, but warns you when you have a failed test.