fix(repo): two backend tests stop leaking rows into later test files (#869) #870

Merged
claude-bot merged 3 commits from fix/869-test-leaks into main 2026-09-27 03:59:31 +00:00
Collaborator

Closes #869.

  • test_recap_email.py: _cleanup now deletes the smtp_config row instead of setting it to None. The leftover row made seven of test_admin's send-test-email tests fail whenever test_recap_email ran first.
  • test_backup_offsite.py: its autouse fixture now deletes the BackupLog rows that its task-style tests commit through the real session.

Proof: I ran test_recap_email.py then test_admin.py, in that order.

  • With main's two test files: 7 failed, the send-test-email tests.
  • With this branch: 166 passed. That run included test_backup_offsite and test_backup_tasks.

ruff is clean, and the changelog.d/ fragment is included.

🤖 Generated with Claude Code

Closes #869. - **`test_recap_email.py`:** `_cleanup` now **deletes** the `smtp_config` row instead of setting it to `None`. The leftover row made seven of `test_admin`'s send-test-email tests fail whenever `test_recap_email` ran first. - **`test_backup_offsite.py`:** its autouse fixture now deletes the `BackupLog` rows that its task-style tests commit through the real session. **Proof:** I ran `test_recap_email.py` then `test_admin.py`, in that order. - With main's two test files: **7 failed**, the send-test-email tests. - With this branch: **166 passed**. That run included `test_backup_offsite` and `test_backup_tasks`. ruff is clean, and the `changelog.d/` fragment is included. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Two tests left state behind that could interfere with later tests:

1. test_recap_email's _cleanup was setting the SMTP config row to None
   instead of deleting it. When test_recap_email runs before test_admin,
   the NULL value causes UniqueViolation errors in the send-test-email
   tests.

2. test_backup_offsite's task tests were committing BackupLog rows that
   were never cleaned up. The autouse _schema fixture now deletes these
   rows after each test, preventing contamination of any test that expects
   an empty backup_logs table.

Closes #869

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
style: ruff format (#869)
Some checks failed
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m15s
CI / Backend lint (ruff) (pull_request) Successful in 42s
CI / Bot tests and audit (pull_request) Successful in 3m26s
CI / Feedback site tests (pull_request) Successful in 1m10s
CI / Docker image build (pull_request) Successful in 35s
CI / Bot/backend version sync (pull_request) Failing after 53s
CI / Does this change touch the recording path? (pull_request) Successful in 16s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Has been cancelled
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
CI / Frontend tests, audit, and build (pull_request) Has been cancelled
6c1ec21dd6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(repo): the #869 changelog fragment is a bullet
All checks were successful
CI / Backend lint (ruff) (pull_request) Successful in 33s
CI / Bot/backend version sync (pull_request) Successful in 29s
CI / Does this change touch the recording path? (pull_request) Successful in 21s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Docker image build (pull_request) Successful in 33s
CI / Feedback site tests (pull_request) Successful in 1m37s
CI / Bot tests and audit (pull_request) Successful in 1m58s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m1s
CI / Frontend tests, audit, and build (pull_request) Successful in 22m44s
CI / Backend migration, tests, and audit (pull_request) Successful in 34m18s
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 34m50s
f2a61d8b0b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.