Testing¶
Running the Test Suite¶
This executes pytest with:
- Coverage reporting for
src/owi/metadatabase/soil - Doctests from source modules and Markdown files
- Doctest directives:
NORMALIZE_WHITESPACE,ELLIPSIS,NUMBER
Test Structure¶
tests/
├── conftest.py # shared fixtures
├── test_imports.py # version assertion
├── soil/
│ ├── test_io.py # SoilAPI method tests
│ └── processing/
│ └── test_soil_pp.py # SoilDataProcessor + SoilprofileProcessor
Mocking Strategy¶
Tests mock owi.metadatabase.soil.io.API.process_data to avoid live HTTP
calls. This boundary is stable — keep it when refactoring API methods.
Adding Tests¶
- Mirror the source module path (e.g.
io.py→test_io.py). - Use the existing
header,soil_init, andapi_soilfixtures. - Parameterise with
@pytest.mark.parametrizefor schema variations.