Skip to content

Commit 1afe5f8

Browse files
committed
MOD: Improve mock live server teardown
1 parent eae7d03 commit 1afe5f8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

tests/conftest.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,17 @@ async def fixture_mock_live_server(
251251

252252
yield mock_live_server
253253

254-
loop.run_in_executor(
255-
None,
256-
loop.stop,
257-
)
258-
thread.join()
254+
asyncio.run_coroutine_threadsafe(
255+
coro=mock_live_server.stop(),
256+
loop=loop,
257+
).result()
258+
259+
loop.run_in_executor(
260+
None,
261+
loop.stop,
262+
)
263+
264+
thread.join()
259265

260266

261267
@pytest.fixture(name="historical_client")

0 commit comments

Comments
 (0)