From dd4c8c8d7873cc7103cd6bf226e8f02cbacc509e Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 19 Apr 2024 14:35:28 +0200 Subject: [PATCH] style(mypy): remove legacy async & await --- src/tests/test_dependencies.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tests/test_dependencies.py b/src/tests/test_dependencies.py index 0042022..c8e8c3d 100644 --- a/src/tests/test_dependencies.py +++ b/src/tests/test_dependencies.py @@ -16,13 +16,12 @@ (["admin"], {"sub": "123", "scopes": ["user"]}, None, 403, None), ], ) -@pytest.mark.asyncio() -async def test_get_token_payload(scopes, token, expires_minutes, error_code, expected_payload): - _token = await create_access_token(token, expires_minutes) if isinstance(token, dict) else token +def test_get_token_payload(scopes, token, expires_minutes, error_code, expected_payload): + _token = create_access_token(token, expires_minutes) if isinstance(token, dict) else token if isinstance(error_code, int): with pytest.raises(HTTPException): - await get_token_payload(SecurityScopes(scopes), _token) + get_token_payload(SecurityScopes(scopes), _token) else: - payload = await get_token_payload(SecurityScopes(scopes), _token) + payload = get_token_payload(SecurityScopes(scopes), _token) if expected_payload is not None: assert payload.model_dump() == expected_payload