Added test for async startup hook, refs #834

This commit is contained in:
Simon Willison 2020-06-13 10:58:32 -07:00
commit 72ae975156
2 changed files with 9 additions and 0 deletions

View file

@ -120,3 +120,11 @@ def permission_allowed(datasette, actor, action):
return False
return inner
@hookimpl
def startup(datasette):
async def inner():
result = await datasette.get_database().execute("select 1 + 1")
datasette._startup_hook_calculation = result.first()[0]
return inner