Skip to content

Register unit/integration/e2e pytest markers, finish the split - #9

Closed
Mearman wants to merge 1 commit into
mainfrom
test/unit-integration-e2e-coverage-60
Closed

Mearman wants to merge 1 commit into
mainfrom
test/unit-integration-e2e-coverage-60

Conversation

@Mearman

@Mearman Mearman commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Registers unit, integration, e2e markers in pyproject.toml and sets pytestmark at module level in every test file, so type is enforceable both by directory and by -m marker selection.
  • Moves the last flat test file, test_cli_lazy_import.py, into the split layout. Under the CliRunner-vs-plain-import line, it actually mixed types (one test just imports the module, two drive it through the Click entrypoint), so it's split into a unit test and an e2e test sharing the block_pandas_and_pywr fixture via a new tests/conftest.py.
  • Renames the unit half to test_cli_module_import_without_deps.py, since pytest's rootless import mode needs unique basenames across the whole tests/ tree.

Test plan

  • pytest -q — 72 passed, 1 xfailed, coverage 99.23% (floor is 97%)
  • pytest tests/unit, pytest tests/integration, pytest tests/e2e each collect and pass independently (27/27/18)
  • pytest -m unit, -m integration, -m e2e return the same sets as the directories
  • mypy pywr_utils/ clean

@Mearman
Mearman requested a review from knoxsp August 9, 2026 21:30
Add unit/integration/e2e marker definitions to pyproject.toml and set
pytestmark at module level on every test file so the type is
enforceable both by directory and by marker selection.

Move the last flat file, test_cli_lazy_import.py, out of tests/ into
the split layout. It mixed types under the CliRunner-vs-plain-import
distinction — one test just imports the module, two drive it through
the Click entrypoint — so it is split into a unit test (import only)
and an e2e test (CliRunner invocations), sharing the
block_pandas_and_pywr fixture via a new tests/conftest.py.

Rename tests/unit/test_cli_lazy_import.py to
test_cli_module_import_without_deps.py: pytest's rootless import mode
requires unique basenames across the whole tests/ tree, and the e2e
file of the same name already exists.
@Mearman

Mearman commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #31 in a stacked chain (#29 -> #30 -> #31 -> #32 -> #33). Same unit/integration/e2e test reorganization and coverage work, reconciled and re-verified via mono's tree.

@Mearman Mearman closed this Sep 17, 2026
auto-merge was automatically disabled September 17, 2026 02:59

Pull request was closed

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.

3 participants