Run the tests on an in-memory store and dispose the engine afterwards

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-17 22:38:36 +08:00
co-authored by Claude Opus 5
parent c3e48aac56
commit a64c04a128
6 changed files with 13 additions and 11 deletions
+2 -2
View File
@@ -38,11 +38,11 @@ class TestTallyCodings(unittest.TestCase):
self.__runs.append(run_dir)
self.__output_csv: Path \
= self.__dir / "results" / "codings.csv"
url: str = f"sqlite:///{self.__dir}/store.sqlite3"
config.set_settings(config.Settings(
SQLALCHEMY_DATABASE_URL=url,
SQLALCHEMY_DATABASE_URL="sqlite://",
ANTHROPIC_API_KEY="test-key"))
self.__ds: DataSource = DataSource()
self.addCleanup(self.__ds.engine.dispose)
patcher: Any = mock.patch.object(
tally_codings, "ds", self.__ds)
patcher.start()