Repository navigation
Conversation
…with pytest 9 develop's CI fails on its own code since the tools moved on: CI installs the newest mypy, pylint and pytest each run. - mypy: MinimalGriddedPerms._better_bounds is annotated as Optional, so that the cache's dict can be assigned to it; FactorFactory's interleaving factor class is cast to the class that takes `tracked` before it is called, as only the interleaving classes reach that call. - pylint (R1716): Tiling.cell_within_bounds uses chained comparisons. - test_positive_reverse_fusion: newer pytest can capture the one warning more than once, as the test also makes logzero's logger propagate, so the test now asserts that this warning is the only one, however often it is captured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cause of the second record, found with pytest 9.1.1: pytest now attaches its log-capture handler to loggers that do not propagate as well, such as logzero's, and this test makes logzero's logger propagate (for older pytest, which captured only through the root logger), so the one record reaches the handler twice, the same object both times. The test counts each record once again, and keeps its assertion that the warning is the only one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
develop's CI fails on its own code. CI installs the newest mypy, pylint and pytest on every run, and they now flag three things that passed in January. A branch pushed at develop's head, c9618e0, fails the same jobs. This pull request fixes them, and changes no behavior.
tilings/algorithms/minimal_gridded_perms.py.MinimalGriddedPerms._better_bounds = Nonegave the cache the typeNone, so assigning the bounds' dict to it, and returning it, were errors. It is annotated asOptional[Dict[FrozenSet[Perm], int]].tilings/strategies/factor.py.FactorFactory._build_strategycallsself.factor_class(..., tracked=...), but mypy typesfactor_classasFactorStrategy, which takes notracked. Only the interleaving classes reach that call, so the class is cast toType[FactorWithInterleavingStrategy]first. Thepylint: disable=E1123stays.tilings/tiling.py.Tiling.cell_within_boundsuses chained comparisons,0 <= cell[0] < i and 0 <= cell[1] < j.tests/strategies/test_reverse_fusion.py::test_positive_reverse_fusion. It asserts that exactly one warning is captured, and pytest 9 captured two. The cause: pytest 9 attaches its log-capture handler to loggers that do not propagate as well, such as logzero's, and the test makes logzero's logger propagate (for older pytest, which captured only through the root logger). So the one record reaches the handler twice, the same object both times. The test now counts each record once, and keeps its assertion.Checked locally with tox, as CI runs it: flake8, mypy 2.4.0, pylint 4.1.3 and black 25.12.0 pass, and so do all 3719 tests on CPython 3.14 and on PyPy 3.11, with pytest 9.1.1.
One thing noticed in passing, and not changed:
FactorFactorysetsself.trackedonly when the factor class isFactorWithInterleavingStrategyorFactorWithMonotoneInterleaving. The latter is the algorithm, not the strategy classFactorWithMonotoneInterleavingStrategy, so monotone interleaving factors are never tracked. That may be intended, or a slip.🤖 Generated with Claude Code