Skip to content

Add comprehensive docstrings to test fixtures #137

@jenniferjiangkells

Description

@jenniferjiangkells

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:

  1. What the fixture provides
  2. When to use it
  3. Key attributes/structure
  4. Related fixtures (if any)

Acceptance Criteria:

  • All fixtures in tests/conftest.py have docstrings
  • Docstrings follow Google or NumPy style guide
  • Docstrings include:
    • One-line summary
    • Detailed description (if needed)
    • Return value description
    • Usage example (optional but encouraged)
  • Consider grouping related fixtures with section comments

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions