Skip to content

Add autouse cleanup fixture for temp DB/files in tests/conftest.py #272

Description

@traoreera

Context

No autouse fixture removes leftover temp files/directories at the end of the test session. The main DB fixture already uses sqlite:///:memory:, so the risk is reduced but not eliminated — fixtures like plugins_dir, temp_dir, fake_plugin_dir create real filesystem entries without a guaranteed session-level teardown.

Flagged in reports/technical_debt_remediation_2026-08-10.md (item 6), confirmed still open in reports/technical_debt_remediation_verification_2026-08-11.md.

Task

Add a session-scoped autouse fixture in tests/conftest.py that cleans up any leftover temp SQLite files / temp directories after the full test run.

Acceptance criteria

  • New fixture in tests/conftest.py, session-scoped, autouse=True
  • Removes known temp artifacts (e.g. db.sqlite3, any stray .db files) after the suite completes
  • Does not break existing tests (make test still green)

Files

  • tests/conftest.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions