From 70efd0f10a4abef0c262020d5ac2aa8f83a9918e Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 20 Jun 2023 23:25:05 +0000 Subject: [PATCH] refactor: use `with` statement with multiple contexts Otherwise `ruff` check SIM117 fails. --- .../src/deltachat_rpc_client/pytestplugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py index 86ae86afd..9b207ecfa 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py @@ -16,9 +16,8 @@ async def get_temp_credentials() -> dict: # Replace default 5 minute timeout with a 1 minute timeout. timeout = aiohttp.ClientTimeout(total=60) - async with aiohttp.ClientSession() as session: - async with session.post(url, timeout=timeout) as response: - return json.loads(await response.text()) + async with aiohttp.ClientSession() as session, session.post(url, timeout=timeout) as response: + return json.loads(await response.text()) class ACFactory: