Match the raise-abandons test doubles to the current session signatures - #682
Merged
Conversation
`_BoomSession.__call__` took `(obs)` and `_BoomPolicy.new_session` took `(context, now, rt)`, so basedpyright rejected both as incompatible overrides and `main` went red at 01f7c5f. Neither pull request was wrong on its own. #676 changed `Session.__call__` to take `time_ns` and `Policy.new_session` to take `rt`; #662 wrote this test against the signatures as they stood before it, and merged after. Each was green alone and the pair is not — the type checker only sees the override against the base once both are on one branch. Every other double in the file already uses these signatures; these two were the only ones left. Ticket: none — restores a red `main`
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.
mainis red at 917111a — bothCheck code styleandRun unit testsfail, on the same two lines._BoomSession.__call__took(obs)and_BoomPolicy.new_sessiontook(context, now, rt). basedpyright rejects both as incompatible overrides, and the harness calls the session with the time, so the test raisesTypeError: __call__() takes 2 positional arguments but 3 were givenatharness.py:61on every platform in the matrix.Why it got in
Neither pull request was wrong on its own.
Session.__call__to taketime_nsandPolicy.new_sessionto takert.Each was green alone. A type checker only sees an override against its base once both are on one branch, so the pair is red and neither PR's own CI could have caught it.
Scope
Every other double in
test_harness.pyalready uses these signatures. A grep overmainfor the stale shapes returns these two methods and nothing else:Verified
uv run --locked basedpyright— 0 errors, 0 warnings (was 2 errors)uv run --locked pytest positronic/policy/tests/test_harness.py— 78 passedruff checkandruff format --checkclean