"""Test doubles shared across modules. Alongside `roster_builders.py`, which does the same job for fixture ROWS. A double written twice in one change, in two test modules, for the same reason belongs in one place — and a file of its own rather than `conftest.py`, which is where fixtures live and gets imported by pytest on its own terms. """ from __future__ import annotations class RecordingSession: """A session double that COLLECTS statements instead of running them. Two production paths now own a sync session and write through it — the sizing sweep's lane samples and its roster refresh — while this suite is async. Rather than reimplement either writer (which would test a copy), a test hands one of these in, then either asserts on what was collected or replays the statements on the real async session. Lives here because it was written twice in one change, in two test modules, for the same reason. """ def __init__(self): self.stmts: list = [] self.commits = 0 def execute(self, stmt): self.stmts.append(stmt) def commit(self) -> None: self.commits += 1