Skip to content

Migrate core runtime tests to source-relative unit modules - #338

Open
juliendenize wants to merge 4 commits into
mistralai:mainfrom
juliendenize:test-modernization/2026-09-23-core-runtime-tests
Open

juliendenize wants to merge 4 commits into
mistralai:mainfrom
juliendenize:test-modernization/2026-09-23-core-runtime-tests

Conversation

@juliendenize

@juliendenize juliendenize commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move core model, deprecation, and optional-dependency tests out of the legacy test root into source-relative unit modules. Preserve every existing assertion while adding focused checks for shared base-model behavior and small runtime utilities. This PR changes tests only; production behavior and public APIs are unchanged.

Changes

  • Relocate base, deprecation, and import assertions to tests/unit/; retain concrete message and chunk filtering cases, warning-key behavior, both cached import states, and exact dependency hints.
  • Use three named pytest parameter cases for the independent empty-base, user-extra-name, and text-extra-annotations filter mappings. Each case retains the original explicit input and full expected result. Keep the stateful warning-key sequence together.
  • Add focused checks for inherited and nested model validation, broken OpenCV imports and custom errors, exception messages, and deterministic UUID generation.
  • Keep the intentionally invalid string default for runtime validation, using only a line-local # type: ignore[assignment]. Assert the exact field and input in its ValidationError while retaining a passing mypy gate.

Review tests/unit/test_base.py for the named filter mappings and model boundary, then tests/unit/test_deprecation.py and tests/unit/test_imports.py for preserved assertions, and finally the new exception and protocol utility tests. No source, CLI, configuration, or contributor-guidance file is changed.

Verification

  • Python 3.12: five focused unit modules, 42 passed both serially and with -n auto --dist loadfile; 12 base nodes include all three named filter cases.

  • Full pytest tests/ -q: 1,776 passed, 16 skipped.

  • ruff check tests and ruff format --check tests: passed; 74 files formatted.

  • mypy .: passed across 122 source files; pytest --doctest-modules ./src: 53 passed.

  • Python 3.10–3.14 CI collection and execution remain to be verified: the repository workflow skips its test jobs while this PR is a draft.

  • Tests added or updated for changed behavior

  • Documentation and public API examples updated where needed (not applicable: test-only changes)

  • Ruff, mypy, and pytest checks pass locally

@juliendenize
juliendenize marked this pull request as ready for review September 24, 2026 11:43

This branch has not been deployed

No deployments
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.

1 participant