Fix auth tests and ruff format (#818)

This commit is contained in:
ihrpr
2025-05-27 17:00:01 +01:00
committed by GitHub
parent 6e418e62f9
commit 9dad26620f
3 changed files with 6 additions and 9 deletions

View File

@@ -359,7 +359,8 @@ class TestOAuthClientProvider:
assert oauth_provider._has_valid_token()
def test_has_valid_token_expired(self, oauth_provider, oauth_token):
@pytest.mark.anyio
async def test_has_valid_token_expired(self, oauth_provider, oauth_token):
"""Test token validation with expired token."""
oauth_provider._current_tokens = oauth_token
oauth_provider._token_expiry_time = time.time() - 3600 # Past expiry
@@ -810,7 +811,8 @@ class TestOAuthClientProvider:
# No scope should be set since client metadata doesn't have explicit scope
assert "scope" not in auth_params
def test_scope_priority_no_scope(self, oauth_provider, oauth_client_info):
@pytest.mark.anyio
async def test_scope_priority_no_scope(self, oauth_provider, oauth_client_info):
"""Test that no scope parameter is set when no scopes specified."""
oauth_provider.client_metadata.scope = None
oauth_provider._client_info = oauth_client_info