Add a shutdown() plugin hook with ordered graceful teardown

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Alex Garcia 2026-07-30 18:10:47 -07:00
commit 940aae1ea5
5 changed files with 448 additions and 4 deletions

View file

@ -53,6 +53,13 @@ def test_hook_jump_items_sql():
assert "jump_items_sql" in dir(pm.hook)
def test_hook_shutdown():
# Detailed behavior (ordering against background-task cancellation and
# close(), idempotency, exception handling, sync vs async support) is
# covered in tests/test_shutdown.py.
assert "shutdown" in dir(pm.hook)
@pytest.mark.asyncio
async def test_hook_plugins_dir_plugin_prepare_connection(ds_client):
response = await ds_client.get(