test: extract shared _runner_aliased_attrs helper in test_runner.py - #307
Conversation
_build_runner and _build_visualize_override_runner each built the same byte-identical six-key alias dict (browser_manager/browser, claim_verifier/verifier, artifact_manager/artifacts) for instantiate_with_aliased_attrs(VisualQARunner, ...). Hoisted it to a single _runner_aliased_attrs helper both builders now call, matching this file's established convention of factoring out duplicated test scaffolding (_skip_preflight, _claim_event_recorder, etc.). Co-authored-by: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe test runner setup now centralizes current and legacy constructor aliases in ChangesRunner alias mapping
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change consolidates duplicated test setup without changing application behavior or the dependencies supplied to the runner tests. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
_build_runnerand_build_visualize_override_runnerintests/test_runner.pyeach built the same byte-identical six-key alias dict (browser_manager/browser,claim_verifier/verifier,artifact_manager/artifacts) forinstantiate_with_aliased_attrs(VisualQARunner, ...)._runner_aliased_attrs(browser, verifier, artifacts)helper both builders now call, matching this file's established convention of factoring out duplicated test scaffolding (_skip_preflight,_claim_event_recorder, etc. — see test: extract shared _skip_preflight helper in test_runner.py #304).Test plan
uv run pytest tests/test_runner.py -q— 43 passeduv run pytest tests/ -q— 326 passed, 21 failed (pre-existing Chromium-sandbox environment failures intest_browser.py/test_live_runner.py, same baseline as before this change)uv run ruff check src/ tests/— cleanuv run ruff format --check tests/test_runner.py— clean (confirmed pre-existing drift in other, untouched files viaruff format --check src/ tests/)🤖 Generated with Claude Code
Generated by Claude Code
Note
Low Risk
Only test scaffolding in
test_runner.py; no application code or runtime behavior changes.Overview
Test-only refactor in
tests/test_runner.py: the identical six-key alias dict passed toinstantiate_with_aliased_attrs(VisualQARunner, …)is no longer duplicated in_build_runnerand_build_visualize_override_runner.A new
_runner_aliased_attrs(browser, verifier, artifacts)helper returns that map (current names plus legacy aliases:browser/browser_manager,verifier/claim_verifier,artifacts/artifact_manager). Both builders now call it instead of inlining the dict.No production or runner behavior change—same wiring for tests that construct
VisualQARunnerwith fakes.Reviewed by Cursor Bugbot for commit d9338d7. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit