test(api): inject disposable databases before API startup (#194)

This commit is contained in:
Vito Sansevero
2026-10-17 07:09:11 -07:00
parent 28eb8aaf4d
commit e3dcfcbf7b
13 changed files with 110 additions and 28 deletions
+1 -2
View File
@@ -70,8 +70,7 @@ class AdminAPITestCase(AioHTTPTestCase):
db_path = os.path.join(self.tmpdir, "prompts.db")
app = web.Application()
routes = web.RouteTableDef()
self.api = PromptManagerAPI()
self.api.db = PromptDatabase(db_path)
self.api = PromptManagerAPI(db=PromptDatabase(db_path))
self.api.add_routes(routes)
app.router.add_routes(routes)
return app