refactor(test[import]) Extract _run_import_defaults to reduce boilerplate#529
Open
refactor(test[import]) Extract _run_import_defaults to reduce boilerplate#529
Conversation
…late why: 63+ call sites repeat identical default kwargs, obscuring test intent. what: - Add _run_import_defaults() helper with test-friendly defaults - Replace all _run_import() calls with _run_import_defaults() - Parameterize 3 structurally identical --sync/--prune test pairs
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #529 +/- ##
=======================================
Coverage 83.51% 83.51%
=======================================
Files 29 29
Lines 3645 3645
Branches 726 726
=======================================
Hits 3044 3044
Misses 386 386
Partials 215 215 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
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.
Summary
_run_import_defaults()wrapper with test-friendly defaults for 9 kwargs_run_import()call sites, keeping only kwargs that differ from defaults--sync/--prunetest pairs usingtyping.NamedTupleNet reduction: -208 lines (436 removed, 228 added). Test count unchanged (77 tests in file).
Test plan
uv run ruff check .— all checks passeduv run ruff format .— no changes neededuv run mypy— no issues founduv run py.test -vvv— 1173 passed