fix(763): satisfy ruff — E741 and formatting on the touched test file
Build ErsatzTV Image / CI toolchain image resolves (pull_request) Successful in 10s
review-verdict/h10 Review-verdict: MERGEABLE @ 11287a5 (base: main)
Build ErsatzTV Image / Delimiter ban (release path) (pull_request) Successful in 19s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 14s
PR Gates / decisions lifecycle (pull_request) Successful in 19s
PR Gates / Docs update reminder (pull_request) Successful in 16s
Review verdict / Set review-verdict status (pull_request_target) Successful in 20s
PR Gates / Fix proofs (Proves trailers) (pull_request) Successful in 17s
PR Gates / Script lint and tests (ruff + pytest) (pull_request) Successful in 6m51s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m24s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 6m5s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Skipped
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 6m6s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 7s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 5s

CI's `Script lint and tests` job went red. Cause: I never ran ruff locally,
which this repo's Python convention requires after any .py change.

  - E741 twice: `l` as a comprehension variable in the sort-order guard.
  - `ruff format --check`: the file was correctly formatted on `main`; my edits
    broke it. One of them left a docstring line at column 0, which `ruff format`
    then "corrected" by over-indenting the rest of the paragraph — repaired at
    the source rather than accepting that rewrite.

Verified the way CI does: local ruff is the pinned 0.12.11, and both
`ruff check` and `ruff format --check` run under bash over the full tracked
population (`git ls-files -z '*.py' '*.pyi' '*.ipynb'`, 46 files) are clean.
The population is counted, not assumed — an empty glob would pass vacuously,
which is the failure `scripts/tests` guards against elsewhere.

`scripts/tests` 1097 passed, 2 skipped after the reformat.

refs #763

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-28 18:51:32 +02:00
co-authored by Claude Opus 5
parent 462118d98d
commit 11287a54ba
+6 -10
View File
@@ -3784,7 +3784,7 @@ def test_a_status_history_RUNNING_PAST_PAGE_1_is_PAGED_and_the_exemption_STANDS(
def test_a_raced_verdict_on_PAGE_2_is_detected_and_repaired(tmp_path):
"""The hole #763 exists to close, and the half a paging change can still get wrong.
A verdict sits BEYOND the first page — 60 ordinary rows with it inserted at index 55 — so only a
A verdict sits BEYOND the first page — 60 ordinary rows with it inserted at index 55 — so only a
walk that continues past page 1 can find it. Under the pre-#763 code the exemption would still
have been repaired here, but for the wrong reason (rows merely EXISTED on page 2), which is why
this test is paired with the one above rather than standing alone: together they separate
@@ -4016,13 +4016,12 @@ def test_the_walk_does_not_request_a_SORT_order(tmp_path):
# The REQUEST LINES ONLY — comments are excluded deliberately, because the withdrawal note inside
# `page_statuses` names the parameter in order to explain why it is not used. A guard that reads
# prose would fire on its own documentation.
requests = [l for l in src.splitlines()
if "statuses/$SHA?" in l and not l.lstrip().startswith("#")]
requests = [line for line in src.splitlines() if "statuses/$SHA?" in line and not line.lstrip().startswith("#")]
assert requests, (
"no `/statuses/{sha}` request line found; the walk has been reshaped, so re-point this guard "
"rather than letting the sort-order assertion below pass vacuously"
)
offenders = [l.strip() for l in requests if "sort=" in l]
offenders = [line.strip() for line in requests if "sort=" in line]
assert not offenders, (
"the status-history request carries a sort order again. ASC ordering puts the OLDEST rows on "
"page 1, which inverts the partial-mark fallback into a spurious sticky repair — the #761 "
@@ -4112,11 +4111,8 @@ def test_a_MALFORMED_creator_row_does_not_kill_the_job_after_the_green_is_posted
The fix type-tests `creator` before indexing it, so the malformed row is dropped from the count
while the real verdict beside it is still counted and still repaired.
"""
posted, r = _run_classify(tmp_path, _emitting("docs/a.md"),
history_mode="malformed-creator-beside-verdict")
assert r.returncode == 0, (
f"the step died instead of skipping a malformed row: {r.stderr[-1200:]}"
)
posted, r = _run_classify(tmp_path, _emitting("docs/a.md"), history_mode="malformed-creator-beside-verdict")
assert r.returncode == 0, f"the step died instead of skipping a malformed row: {r.stderr[-1200:]}"
seq = _posted_sequence(tmp_path)
assert len(seq) == 2, (
"a malformed `creator` row suppressed the repair, leaving the exemption green over the real "
@@ -4137,7 +4133,7 @@ def test_a_MALFORMED_creator_row_does_not_kill_the_job_after_the_green_is_posted
def test_a_verdict_BEYOND_A_SHORT_PAGE_is_still_found(tmp_path):
""""Terminate only on a validated EMPTY page, never on a short one" — the rule that is invisible
""" "Terminate only on a validated EMPTY page, never on a short one" — the rule that is invisible
against a faithful double.
On the real endpoint a short page IS the last page (measured: 50, 50, 14, `[]`), so an