Commands for Testing: Necessary Details

Learn how to test pre-commit and track hooks

Testing pre-commit

Now, it’s possible that the Sphinx developers change their output wording. In that case, pre-commit will think we need to re-run the documentation, but it will still reject the commit. Clearly, there is still room for improvement here, but this will do for now.

Note that if one of the tests fails, the test script will exit with an error code. This will cause the commit script to stop at that point and exit with an error code, and the commit will be blocked. The developer must then fix the issue so that all tests pass before committing the updates.

Get hands-on with 1200+ tech skills courses.