add comprehensive docstrings to test fixtures #144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves test maintainability and onboarding by adding clear, Google-style docstrings to all fixtures in
tests/conftest.py
and by hardening a few fixtures to avoid brittle behavior and cross-test side effects. No production code behavior is changed — only test utilities and their documentation.Related issue #137
What I changed
@pytest.fixture
intests/conftest.py
, including:Returns:
orYields:
sectionExample:
blocks for complex fixturesPath(__file__).parent / "data" / ...
.copy.deepcopy
intest_allergy_with_reaction
andtest_medication_with_dosage
to avoid mutating fixtures passed as inputs.doc_ref_without_content
to constructDocumentReferenceContent
+Attachment
(instead of a plain dict) for FHIR object consistency.config_fixtures
yields a temporary config directory and writes representative YAML files used by config-related tests.real_config_dir
definitions (kept the robust implementation thatpytest.skip
s when configs are absent).cda_adapter
docstring.Why
Acceptance criteria
Returns
/Yields
.See Also
or examples where appropriate.