The test fixtures in tests/conftest.py lack comprehensive docstrings explaining their purpose, structure, and usage. This makes it harder for new contributors to understand available test utilities when writing tests.
File: tests/conftest.py
Current state:
@pytest.fixture
def test_condition():
# TODO: Tidy up fixtures
return Condition(...) # What does this fixture provide? When should I use it?
Goal:
Add clear, comprehensive docstrings to all fixtures explaining:
- What the fixture provides
- When to use it
- Key attributes/structure
- Related fixtures (if any)
Acceptance Criteria:
Example format:
@pytest.fixture
def test_condition():
"""Create a sample FHIR Condition resource for testing.
Provides a basic Condition resource representing hypertension (I10)
with standard test patient reference. Use this fixture when testing
components that process or transform Condition resources.
Returns:
Condition: A FHIR Condition resource with:
- subject: "Patient/123"
- code: I10 (Essential hypertension)
- clinicalStatus: active
See also:
- test_condition_list: Multiple conditions
- test_bundle: Bundle containing condition
"""
return Condition(...)
Resources:
The test fixtures in
tests/conftest.pylack comprehensive docstrings explaining their purpose, structure, and usage. This makes it harder for new contributors to understand available test utilities when writing tests.File:
tests/conftest.pyCurrent state:
Goal:
Add clear, comprehensive docstrings to all fixtures explaining:
Acceptance Criteria:
tests/conftest.pyhave docstringsExample format:
Resources:
healthchain/fhir/helpers.pyfor examples