diff --git a/tests/client/test_auth.py b/tests/client/test_auth.py index 5e5dbb2ee5..f7d71b2044 100644 --- a/tests/client/test_auth.py +++ b/tests/client/test_auth.py @@ -157,7 +157,7 @@ async def test_init(self, oauth_provider, client_metadata, mock_storage): assert oauth_provider.timeout == 300.0 @pytest.mark.anyio - def test_generate_code_verifier(self, oauth_provider): + async def test_generate_code_verifier(self, oauth_provider): """Test PKCE code verifier generation.""" verifier = oauth_provider._generate_code_verifier() @@ -175,7 +175,7 @@ def test_generate_code_verifier(self, oauth_provider): assert len(verifiers) == 10 @pytest.mark.anyio - def test_generate_code_challenge(self, oauth_provider): + async def test_generate_code_challenge(self, oauth_provider): """Test PKCE code challenge generation.""" verifier = "test_code_verifier_123" challenge = oauth_provider._generate_code_challenge(verifier) @@ -194,7 +194,7 @@ def test_generate_code_challenge(self, oauth_provider): assert "/" not in challenge @pytest.mark.anyio - def test_get_authorization_base_url(self, oauth_provider): + async def test_get_authorization_base_url(self, oauth_provider): """Test authorization base URL extraction.""" # Test with path assert ( @@ -370,12 +370,12 @@ async def test_register_oauth_client_failure(self, oauth_provider): ) @pytest.mark.anyio - def test_has_valid_token_no_token(self, oauth_provider): + async def test_has_valid_token_no_token(self, oauth_provider): """Test token validation with no token.""" assert not oauth_provider._has_valid_token() @pytest.mark.anyio - def test_has_valid_token_valid(self, oauth_provider, oauth_token): + async def test_has_valid_token_valid(self, oauth_provider, oauth_token): """Test token validation with valid token.""" oauth_provider._current_tokens = oauth_token oauth_provider._token_expiry_time = time.time() + 3600 # Future expiry @@ -780,7 +780,7 @@ async def test_async_auth_flow_no_token(self, oauth_provider): assert "Authorization" not in updated_request.headers @pytest.mark.anyio - def test_scope_priority_client_metadata_first( + async def test_scope_priority_client_metadata_first( self, oauth_provider, oauth_client_info ): """Test that client metadata scope takes priority.""" @@ -810,7 +810,7 @@ def test_scope_priority_client_metadata_first( assert auth_params["scope"] == "read write" @pytest.mark.anyio - def test_scope_priority_no_client_metadata_scope( + async def test_scope_priority_no_client_metadata_scope( self, oauth_provider, oauth_client_info ): """Test that no scope parameter is set when client metadata has no scope."""