Skip to content

Files

Latest commit

3e010db · Jul 12, 2023

History

History
50 lines (33 loc) · 1.2 KB
·

testing_strategy.md

File metadata and controls

50 lines (33 loc) · 1.2 KB
·

Testing Strategy

We strive for high test coverage and to add tests for new functionality and bug fixes that are merged with the code changes.

Running the tests

All tests can be run with the command:

make test

This starts a database container, waits for it to be ready, runs the unit tests, and calculates the combined code coverage. See bin/test.sh for details.

Pytest for unit tests

We are using pytest for unit testing as well as integration testing with the database.

  • The tests live in: tests/unit/*.py
  • The shared test fixtures live in: tests/unit/conftest.py

Pass arguments to pytest

Set the PYTEST_ADDOPTS env var to pass arguments to pytest.

Run in verbose mode (works for both unit and integration tests):

export PYTEST_ADDOPTS="-v"

To stop on the first failure and drop into pdb:

export PYTEST_ADDOPTS="-sx --pdb"

To run a test or tests whose name matchs a substring:

export PYTEST_ADDOPTS='-k "substring"'

View the pytest documentation for more options.


View All Docs