Repository navigation
fix(tests): add result_json to Parsed() calls for tox 4.59 compat - #595
Conversation
tox 4.59.0 (tox-dev/tox#4014) changed State.__init__ to access options.parsed.result_json directly instead of using getattr with a fallback default. This breaks tests that construct Parsed objects without including result_json, causing AttributeError in 28 tests. Adding result_json=None to all Parsed() constructor calls in the test suite fixes the devel test failures.
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe pull request updates unit-test ChangesParsed fixture updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/test_downstream_matrix.py (1)
54-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAlign
result_json=Nonein every multilineParsedfixture.The new argument is consistently under-indented at all listed sites. Align it with the other keyword arguments.
- tests/unit/test_downstream_matrix.py#L54-L54: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L964-L964: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L1026-L1026: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L1083-L1083: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L1170-L1170: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L1222-L1222: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin.py#L1343-L1343: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L382-L382: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L426-L426: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L471-L471: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L515-L515: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L558-L558: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L619-L619: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L666-L666: indent
result_json=Noneby eight spaces.- tests/unit/test_plugin_molecule.py#L740-L740: indent
result_json=Noneby eight spaces.As per path instructions, this review prioritizes readability and maintainability.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/test_downstream_matrix.py` at line 54, Align the result_json=None argument with the other keyword arguments in every multiline Parsed fixture: tests/unit/test_downstream_matrix.py lines 54-54; tests/unit/test_plugin.py lines 964-964, 1026-1026, 1083-1083, 1170-1170, 1222-1222, and 1343-1343; and tests/unit/test_plugin_molecule.py lines 382-382, 426-426, 471-471, 515-515, 558-558, 619-619, 666-666, and 740-740. Indent each occurrence by eight spaces without changing fixture behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/test_downstream_matrix.py`:
- Line 54: Align the result_json=None argument with the other keyword arguments
in every multiline Parsed fixture: tests/unit/test_downstream_matrix.py lines
54-54; tests/unit/test_plugin.py lines 964-964, 1026-1026, 1083-1083, 1170-1170,
1222-1222, and 1343-1343; and tests/unit/test_plugin_molecule.py lines 382-382,
426-426, 471-471, 515-515, 558-558, 619-619, 666-666, and 740-740. Indent each
occurrence by eight spaces without changing fixture behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 653ed61f-ac37-4ed5-9c08-f738bc844097
📒 Files selected for processing (3)
tests/unit/test_downstream_matrix.pytests/unit/test_plugin.pytests/unit/test_plugin_molecule.py
Replace 26 verbose multi-line Parsed() calls with a compact _parsed() helper that sets default override=[] and result_json=None. Brings the module from 1644 lines back under the 1600 pylint limit.
Summary
State.__init__intox/session/state.pyto accessoptions.parsed.result_jsondirectly instead of usinggetattrwith a fallback default.Parsed()objects without includingresult_json, causingAttributeError: 'Parsed' object has no attribute 'result_json'.result_json=Noneto allParsed()constructor calls across 3 test files fixes the failures.Files changed
tests/unit/test_downstream_matrix.py(1 call)tests/unit/test_plugin.py(26 calls)tests/unit/test_plugin_molecule.py(11 calls)Test plan
Summary by CodeRabbit