Repository navigation
test: run test_model_fields in CI again - #164
Open
matthiasschabel wants to merge 1 commit into
Open
matthiasschabel wants to merge 1 commit into
matthiasschabel wants to merge 1 commit into
Conversation
tests/test_model_fields.py imports BaseModel from pydantic_compat, which was never a declared test dependency. It arrived through napari's app-model until app-model 0.5.0 dropped it, and since then the module-level except ImportError has skipped the whole file in every CI job, reporting "pydantic not installed" while pydantic was installed. Declare pydantic-compat in the test_thirdparty group, and skip only when pydantic itself is missing, so a missing pydantic_compat fails collection instead of skipping silently. Reviewed-By: Codex (gpt-6-astra, reasoning effort medium) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
==========================================
+ Coverage 94.62% 95.74% +1.12%
==========================================
Files 168 168
Lines 2231 2231
==========================================
+ Hits 2111 2136 +25
+ Misses 120 95 -25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@tlambert03 I don't understand the pydantic/CI stuff well enough to really carefully review this - it's mostly Claude's work reviewed by Codex...but it is pretty small, appears to fix the issue, and seems to make sense. |
matthiasschabel
marked this pull request as ready for review
October 17, 2026 19:15
This branch has not been deployed
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.
tests/test_model_fields.pyis skipped in all 15 jobs of the CI test matrix, so the pydantic and psygnal tests aren't running.BaseModelfrompydantic_compat, which was never a declared test dependency. It came in through napari'sapp-model, which dropped it in 0.5.0.try/except ImportErrorwithimport pydantic, so the module skips with "pydantic not installed" even though pydantic is installed.This PR adds
pydantic-compatto thetest_thirdpartygroup and skips only when pydantic itself is missing, so a missingpydantic_compatnow fails collection instead of skipping. Thetest_minjob still skips the module.I kept the shim rather than switching to
pydantic.BaseModel, becausetest_pydantic_validaterelies on it for.json()and the class-basedConfig, which warn under pydantic 2 and fail withfilterwarnings = ["error"].The 5 lines
codecov/patchreports as missing on #155 are the pydantic serializer, which is only tested in this file.🤖 Generated with Claude Code