-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename README.tests.md to CONTRIBUTING.md and add information about running tests and pre-commit checks.
- Loading branch information
Showing
2 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Contributing | ||
|
||
## Pre-commit | ||
|
||
We use [pre-commit] to run a series of [linters] on the code in this | ||
repository. These checks will be run whenever you submit a pull request. In | ||
order to avoid delays in getting your pull request reviewed, you will want to | ||
enable these same checks as part of your local development workflow: | ||
|
||
1. Install the [pre-commit] tool. | ||
1. From the root of this repository, run: | ||
|
||
``` | ||
pre-commit install | ||
``` | ||
|
||
This will modify `.git/hooks/pre-commit` in your local repository to run the | ||
pre-commit checks each time you make a commit. Among other things, these | ||
linters will ensure consistent formatting of Python code in the repository and | ||
alert on a variety of syntax errors. | ||
|
||
[pre-commit]: https://pre-commit.com/ | ||
[linters]: https://en.wikipedia.org/wiki/Lint_(software) | ||
|
||
## Unit tests | ||
|
||
### Install prerequisites | ||
|
||
Install the dependencies from `test-requirements.txt`: | ||
|
||
``` | ||
pip install -r test-requirements.txt | ||
``` | ||
|
||
### Run the tests | ||
|
||
To run the unit tests, from the top level of the repository run: | ||
|
||
``` | ||
pytest | ||
``` | ||
|
||
To generate HTML coverage reports: | ||
|
||
``` | ||
pytest --cov-report=html | ||
``` | ||
|
||
Then open `htmlcov/index.html` in your browser. |
This file was deleted.
Oops, something went wrong.