diff --git a/tests/plugins/my_plugin_2.py b/tests/plugins/my_plugin_2.py index 039112f4..bdfaea8d 100644 --- a/tests/plugins/my_plugin_2.py +++ b/tests/plugins/my_plugin_2.py @@ -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 diff --git a/tests/test_plugins.py b/tests/test_plugins.py index c0a7438f..bc759385 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -578,3 +578,4 @@ def test_register_routes_asgi(app_client): async def test_startup(app_client): await app_client.ds.invoke_startup() assert app_client.ds._startup_hook_fired + assert 2 == app_client.ds._startup_hook_calculation