Shape audit area 1 — tests/: one definition each for the copied fixtures and fakes (#2825) #119

Merged
bvandeusen merged 1 commits from dev into main 2026-08-21 11:07:11 -04:00
Owner

Milestone 296 area 1. The shape ledger showed the same test scaffolding defined over and over — _bind_user ×12, _dispose_engine ×10, _no_supersession ×3, _make_mock_session ×7, a get-or-create User helper ×2 (+3 inlined), and fifteen MagicMock note factories each re-explaining the note-2109 hazard.

Now: tests/conftest.py carries _bind_user / _dispose_engine / _no_supersession as opt-in fixtures (pytestmark = pytest.mark.usefixtures(...) per module), and tests/helpers.py carries make_mock_session(), ensure_user() and fake_note(**attrs). 37 files, −605/+235. dev CI run 4138 green.

Merging so the project-2 repo binding (ref=main) sees the consolidation and the ledger refresh can re-read the tree.

🤖 Generated with Claude Code

Milestone 296 area 1. The shape ledger showed the same test scaffolding defined over and over — `_bind_user` ×12, `_dispose_engine` ×10, `_no_supersession` ×3, `_make_mock_session` ×7, a get-or-create User helper ×2 (+3 inlined), and fifteen MagicMock note factories each re-explaining the note-2109 hazard. Now: `tests/conftest.py` carries `_bind_user` / `_dispose_engine` / `_no_supersession` as opt-in fixtures (`pytestmark = pytest.mark.usefixtures(...)` per module), and `tests/helpers.py` carries `make_mock_session()`, `ensure_user()` and `fake_note(**attrs)`. 37 files, −605/+235. dev CI run 4138 green. Merging so the project-2 repo binding (ref=main) sees the consolidation and the ledger refresh can re-read the tree. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-08-21 11:07:03 -04:00
refactor(tests): one definition each for the copied fixtures and fakes (#2825, milestone 296 area 1)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 8s
CI & Build / integration (push) Successful in 24s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 54s
CI & Build / Build & push image (push) Successful in 18s
bbee0d0db1
The shape ledger showed the same test scaffolding defined over and over:
_bind_user x12 (byte-identical), _dispose_engine x10 in three wordings,
_no_supersession x3, _make_mock_session x7 in three subsets, a get-or-create
User helper x2 (+3 inlined), and fifteen hand-rolled MagicMock note factories
each re-explaining the same "an auto-MagicMock attribute is truthy" hazard
(note 2109).

Now: conftest.py carries _bind_user / _dispose_engine / _no_supersession as
opt-in fixtures (pytestmark = usefixtures(...) per module, so unit tests pay
nothing), and tests/helpers.py carries make_mock_session(), ensure_user() and
fake_note(**attrs) — the hazard documented once, real values on every
attribute the product reads. Call sites were rewritten by AST so titles with
dashes and commas survived; the three SimpleNamespace _note stand-ins that
only feed a single function stay local.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bvandeusen merged commit ac6f248bf9 into main 2026-08-21 11:07:11 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#119