Running Tests
The project uses pytest for testing. Tests are run automatically with linting checks.Run All Tests
- Runs tests in parallel using
pytest-xdist(-n auto) - Stops after 10 failures (
--maxfail=10) - Executes all tests in the
tests/directory
Run Tests Only (Skip Linting)
Run Tests in Docker
To run tests in a Docker container:Test Configuration
pytest.ini
The pytest configuration is defined inpytest.ini:
Test Structure
Tests are organized in thetests/ directory:
Common Fixtures
Key fixtures available intests/conftest.py:
app_- Flask application instanceclient- Test client for making requestsrmock- requests-mock instance for mocking HTTP requestssample_service- Sample service dataservice_id,document_id,key- Test identifiersdocument_has_metadata_no_confirmation- Mock document without email confirmationdocument_has_metadata_requires_confirmation- Mock document requiring email confirmation
Writing Tests
Example test using fixtures:Bootstrap Testing Environment
To set up the testing environment:requirements_for_test.txt and builds frontend assets.