From 67a1bc740d2e8860ee3aaffc4a97dc594d028d87 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 15 Jun 2026 21:39:41 -0400 Subject: [PATCH] fix(test): call sync create_app directly in ansible inventory integration test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit create_app is synchronous (returns Quart) and runs its own internal asyncio.run for settings/migrations. _make_app wrapped it in asyncio.run, which nested event loops and raised "a coroutine is required" — the other integration tests already call create_app() directly. This test was added in an unpushed commit, so CI never exercised it until now. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/integration/test_ansible_inventory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_ansible_inventory.py b/tests/integration/test_ansible_inventory.py index 57e65e1..711f4e0 100644 --- a/tests/integration/test_ansible_inventory.py +++ b/tests/integration/test_ansible_inventory.py @@ -20,9 +20,11 @@ _NEEDS_DB = pytest.mark.skipif( def _make_app(): + # create_app is synchronous and runs its own internal asyncio.run for + # settings/migrations — call it directly (matching the other integration + # tests); wrapping it in asyncio.run nests event loops and fails. from steward.app import create_app - import asyncio - return asyncio.run(create_app(testing=False)) + return create_app(testing=False) @_NEEDS_DB