Skip to content

Reformat two asserts in the conversation render tests so ruff format passes - #94

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-33163125560
Aug 28, 2026
Merged

Reformat two asserts in the conversation render tests so ruff format passes#94
max-sixty merged 1 commit into
mainfrom
fix/ci-33163125560

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

lint is red on main: ruff format rewrites tests/test_render_conversations.py, so pre-commit reports "files were modified by this hook" and the job fails. The two asserts dbfaeaa ("End cancelled panel gestures") added carry ruff's older assert shape — condition wrapped in parentheses, message trailing — where 0.16.1 puts the message in parentheses after a bare condition. This commit applies ruff@0.16.1 format, which is the hook's own output; there is no other change.

Verified on the branch (rebased onto ea2f4e7, main's current head): ruff@0.16.1 format --check .123 files already formatted, and ruff@0.16.1 check --no-fix .All checks passed!. The test job was already green on the failing run, and this diff is whitespace and parentheses only, so behaviour is unchanged; the touched test collects (its local run stops at BrowserType.launch — no Playwright browser in the tend sandbox).

The hook's diff, from the failed run
@@ -2326,9 +2326,9 @@ def test_a_cancelled_panel_press_does_not_suppress_the_next_focus_landing(
         before = page.evaluate("() => document.querySelector('.lf-threads').scrollTop")
-        assert (
-            page.evaluate(UNDER_HEADING)["covered"] >= 20
-        ), "the setup did not put the first card under its heading"
+        assert page.evaluate(UNDER_HEADING)["covered"] >= 20, (
+            "the setup did not put the first card under its heading"
+        )

The second hunk is the same rewrite on the COVERED_TOP assert at line 2344.

Third `ruff` failure on main today

lint has gone red on four of the last twelve ci runs on main, each on a different ruff finding in the commit that had just landed: 56891785 and ac8fe9e (both since fixed by later commits, closing #89 and #90), and now this one. Nothing in the repo can catch these earlier — wt merge's pre-commit on the maintainer's machine is the only gate ahead of CI, and each of these reached main with the hook's own output unapplied. That is a local-flow observation, not something this PR changes.


Automated fix for failed run

`ruff format` 0.16.1 puts an assert's message inside parentheses after the
condition rather than wrapping the condition itself. Two asserts added with the
cancelled-panel-gesture test carry the older shape, so the `ruff format` hook
rewrites the file and `pre-commit` fails the `lint` job on main.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Same failure again on main, one commit later: run 33163787168 on 4b02f53 ("Extract conversation reaction surfaces"). The hook diff in that run is byte-identical to this PR's — the same two asserts in tests/test_render_conversations.py, same hunks — so it is this fix still being unmerged rather than a second finding. test was green there too.

The fix still applies unchanged at main's current head, fdb8b0a: both asserts are still in their pre-format shape there, and git diff --name-only ea2f4e7..fdb8b0a -- '*.py' is empty, so nothing has landed since this branch's base that would add a second ruff format finding. No rebase needed.

Not opening a second PR for the new run.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

One correction to the note above, in this PR's favour: Python has landed since this branch's base now, so that check needs redoing at main's current head — and it still comes back clean. git diff --name-only ea2f4e7..c86c0cc -- '*.py' lists six files (agent_state.py, http.py, presence.py, served_state.py, test_interact_server.py, test_interact_session.py), and running the hook's own pinned ruff@0.16.1 over c86c0cc gives 1 file would be reformatted, 123 files already formatted — the one file being tests/test_render_conversations.py, on the same two asserts this PR rewrites. ruff check --no-fix . is All checks passed!. So this branch is still the whole of lint on main, and still needs no rebase.

The occurrence that sent me here, run 33164610688 on ce5e352, is an older commit than the one already recorded above, so it adds nothing beyond the count. Not opening a second PR.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Still the same failure, now on run 33166597109 (9ae8f83, "Extract source history validation") — byte-identical hook diff, same two asserts. lint has been red on every push to main since dbfaeaa; the four runs in flight right now will fail the same way.

Re-verified at main's current head d6d377a (five commits past the head of the last check above): ruff@0.16.1 format --check . reports 1 file would be reformatted, 128 files already formatted, and the diff it prints is exactly this PR's two hunks — nothing new has crept in, so this PR is still the whole fix. ruff@0.16.1 check --no-fix .All checks passed!. No new PR opened for this run.

@max-sixty
max-sixty merged commit 7c47c4e into main Aug 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/ci-33163125560 branch August 28, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants