Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
style(mypy): remove legacy async & await
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Apr 19, 2024
1 parent cef94b2 commit dd4c8c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/tests/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dd4c8c8

Please sign in to comment.