Skip to content

chore: give every coverage pragma a reason (TS6) - #198

Merged
lesnik512 merged 1 commit into
mainfrom
chore/pragma-reasons
Sep 27, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
chore/pragma-reasons

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Brings the repo in line with TS5 and TS6: every # pragma: no cover now carries its reason on the same line. exclude_also was already ["if typing.TYPE_CHECKING:"] and no package file is omitted.

Of the 23 bare pragmas:

  • Tested: 9. The upstream-mirrored fall-throughs in OutboxSubscriber.consume / process_message are reachable from user code. New tests in tests/test_fake.py cover them: a custom parser= that raises, a handler filter= that matches nothing, a middleware whose after_processed suppresses the no-handler error, and a handler raising StopConsume or SystemExit (with a FastStream app in context). The "unreachable" comments on those lines were wrong, so they are removed.
  • Deleted: 0.
  • Reasoned: 14. These are the optional asyncpg import fallback, the TestBroker abstract create_publisher_fake_subscriber, the Postgres-unreachable skip in two fixtures, the timeout/failure tails of test polling helpers, a drain-guard stub, and the lease-steal block in test_batched_flush_lease_lost_row_redelivers. I checked that last one: with the pragma removed, coverage on Python 3.11 sometimes misses steal_conn.execute, so it stays. The three-line comment above the row not deleted poll is folded into its same-line reasons.

Local checks:

  • just install: ok
  • just lint-ci: pass
  • just test-ci against Postgres 17 (compose settings): 629 passed, coverage 100% on Python 3.14. It also passes at 100% on Python 3.11.

Test the upstream-mirrored consume/process_message fall-throughs (parser
error, no matching filter, suppressed no-handler error, StopConsume,
SystemExit) and drop their pragmas; give the rest a same-line reason.
@github-actions

Copy link
Copy Markdown

Benchmark gate

✅ gate passed

scenario msg/s delete/msg WALrec/msg WALB/msg fpi upd del dead_tup
consumer/w1/b10 994 1.000 6.77 911 242 5000 5000 10000
consumer/w1/b100 1020 1.000 6.83 920 243 5000 5000 10000
consumer/w2/b10 1139 1.000 6.81 973 242 5000 5000 10000
consumer/w2/b100 1334 1.000 6.72 953 243 5000 5000 10000
consumer/w4/b10 1036 1.000 6.82 996 261 5000 5000 10000
consumer/w4/b100 1559 1.000 6.86 1037 244 5000 5000 10000
consumer/w1/b100/tfbs100 5295 0.010 6.07 1116 243 5000 5000 10000
producer/w1/b100 2118 0.000 3.04 584 0 0 0 0

Gated (fails the build): delete_calls + tuple counters (upd/del/ins) + the producer's insert_calls, exact; select_calls within +2; wal_records within a 10% band. msg/s, WAL bytes and total calls are informational (timing/FPI noise).

@lesnik512
lesnik512 merged commit 00b7a66 into main Sep 27, 2026
13 checks passed
@lesnik512
lesnik512 deleted the chore/pragma-reasons branch September 27, 2026 16:34
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.

1 participant