mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
15 lines
No EOL
863 B
Text
15 lines
No EOL
863 B
Text
In order to run automatic tests and know test coverage, following commands are suggested (notice that will run
|
|
ALL pre_commit_hooks tests, not only Loaderon's):
|
|
|
|
coverage erase
|
|
coverage run --source pre_commit_hooks -m pytest
|
|
coverage report --fail-under 100
|
|
|
|
#######################################################################################################################
|
|
|
|
Each automatic test method should have three stages:
|
|
-Initialization: declaring and specification of all necessary variables and data for the test.
|
|
-Execution: run all to-be-tested procedures.
|
|
-Restoration: Eventual undoing of actions that may have changed external configurations. So as to ensure unit testing
|
|
isolation. Restoration should go before verification in case test fails.
|
|
-Verification: checking of obtained results. Might not be necessary when an exception is expected. |