Skip to content

test: add pytest markers (@unit / @integration) to all legacy test files#983

Merged
lior-antonov merged 1 commit into
masterfrom
issue964
Jul 16, 2026
Merged

test: add pytest markers (@unit / @integration) to all legacy test files#983
lior-antonov merged 1 commit into
masterfrom
issue964

Conversation

@ilayfalach

Copy link
Copy Markdown
Collaborator

Closes #964

What

Adds @pytest.mark.unit / @pytest.mark.integration markers to all 267 tests in the 9 legacy test files that were previously unmarked and therefore invisible to pytest -m unit:

File unit integration
test_datalayer.py 33 63
test_demography.py 0 54
test_experiment.py 6 29
test_highfreq.py 9 26
test_lowfreq.py 1 19
test_topography.py 0 13
test_landcover.py 0 12
test_repository.py 3 4
test_workflow_execution.py 6 1

Classification 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, except TestLoadRepositoryFromPath (mixed) which uses function-level markers.

Verification

  • Diff is 95 pure insertions, 0 deletions — every added line is a @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 unit without 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

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>
@lior-antonov
lior-antonov merged commit 0811c11 into master Jul 16, 2026
1 check passed
@lior-antonov
lior-antonov deleted the issue964 branch July 16, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add pytest markers (@unit / @integration) to all legacy test files

2 participants