Turn start_rpc_server into a context manager

This commit is contained in:
link2xt
2022-12-01 16:36:36 +00:00
parent 53d6807e8d
commit 85b4746516
3 changed files with 44 additions and 38 deletions

View File

@@ -10,9 +10,10 @@ from deltachat_rpc_client import Deltachat
@pytest_asyncio.fixture
async def rpc(tmp_path):
return await deltachat_rpc_client.start_rpc_server(
async with deltachat_rpc_client.start_rpc_server(
env={**os.environ, "DC_ACCOUNTS_PATH": str(tmp_path / "accounts")}
)
) as rpc:
yield rpc
@pytest.mark.asyncio