Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document testing use of @pytest.mark.disable_db #4726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ Ideally these tests would avoid mocking.

This lets us test views with all the surrounding parts turned: URL routing, middleware, etc.

### Notes for test authors

All tests have access to the database by default. You should mark up tests that
don't require such access with `@pytest.mark.disable_db`. This significantly
speeds up executing the tests in isolation as the test DB doesn't need to be
spun up and prepared. Note that you can apply this marker at test, class, or
module level. [See the pytest
docs](https://docs.pytest.org/en/7.1.x/example/markers.html).

## Tooling
We use [coverage.py](https://coverage.readthedocs.io/) to check test coverage on the code base and require 100% coverage for CI to pass.
Expand Down