test: add pytest markers (@unit / @integration) to all legacy test files#983
Merged
Conversation
Classify all 267 tests in the legacy test files with @pytest.mark.unit or @pytest.mark.integration so they are selectable via `pytest -m unit` (no MongoDB needed) and `pytest -m integration` (CI with MongoDB). Markers only — no test logic changed (diff is pure decorator insertions). Closes #964 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #964
What
Adds
@pytest.mark.unit/@pytest.mark.integrationmarkers to all 267 tests in the 9 legacy test files that were previously unmarked and therefore invisible topytest -m unit:test_datalayer.pytest_demography.pytest_experiment.pytest_highfreq.pytest_lowfreq.pytest_topography.pytest_landcover.pytest_repository.pytest_workflow_execution.pyClassification rule: tests using conftest Project/toolkit fixtures (
hera_test_project,topo_toolkit,lf_toolkit, ...), MongoDB, on-disk data repositories, or subprocess runs →integration; pure in-memory logic →unit. Markers are class-level, exceptTestLoadRepositoryFromPath(mixed) which uses function-level markers.Verification
@pytest.mark.*decorator; no test logic, names, assertions, or fixtures changed.pytest hera/tests/ -m "not unit and not integration"on the 9 files → 0 tests collected (nothing left unmarked).pytest hera/tests/ -m unitwithout MongoDB running: 147 passed, 1 skipped, 0 errors.pytest hera/tests/ -m integration --collect-only: 214 tests collected, no collection errors.🤖 Generated with Claude Code