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.
Run all Python tests in a directoryIn the Project tool window, select the directory that contains tests to be executed. From the context menu, select the corresponding run command. If the directory contains tests that belong to the different testing frameworks, select the configuration to be used.
To set a test runner, press Ctrl+Alt+S to open the IDE settings and select Tools | Python Integrated Tools, and then select the target test runner from the Default test runner list.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With