test: fix zip(strict=) py3.9 breakage in tri-comparison reconcile test - #2372
Merged
Merged
Conversation
test_single_occurrence_name_unchanged used zip(..., strict=True), whose strict= keyword is Python 3.10+. The repo declares requires-python >=3.9 and the CI matrix runs 3.9, so this raised TypeError: zip() takes no keyword arguments on every 3.9 job, failing full-suite-matrix on all open PRs. _reconcile returns a fixed-shape tuple, so line_result[:3] and rank_result[:3] are always the same length -- compare them positionally via list comprehensions instead, which needs no zip and keeps flake8- bugbear's B905 (zip-without-strict) satisfied. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
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.
Problem
tests/tools/test_tri_comparison_reconcile.py::test_single_occurrence_name_unchangeduses
zip(line_result[:3], rank_result[:3], strict=True). Thestrict=keyword on
zip()is Python 3.10+; on 3.9 it raisesTypeError: zip() takes no keyword arguments.The repo declares
requires-python = ">=3.9"and the CI matrix includes3.9, so this fails
full-suite-matrix (*, 3.9)on every open PR (e.g.#2371) and on
mainitself.Fix
_reconcilereturns a fixed-shape tuple, soline_result[:3]andrank_result[:3]are always equal length. Compare them positionally withlist comprehensions — no
zip, and flake8-bugbear'sB905(zip-without-explicit-strict) stays satisfied.
Test-only change; no engine/parsing paths touched.
🤖 Generated with Claude Code