From 84e7e47ac91880f60dd7200b200a5410d634cd51 Mon Sep 17 00:00:00 2001 From: Nandha Reddy Date: Sat, 31 May 2025 16:56:47 +1000 Subject: [PATCH] Fix: Convert sync tests using async fixtures to async tests Two test methods in test_auth.py were using the async oauth_provider fixture but were not marked as async tests: - test_scope_priority_client_metadata_first - test_scope_priority_no_client_metadata_scope This caused AttributeError: 'coroutine' object has no attribute 'client_metadata' when running tests locally with pytest-anyio. Added @pytest.mark.anyio decorator and converted both methods to async, following the pattern established in commit 9dad266. --- tests/client/test_auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/client/test_auth.py b/tests/client/test_auth.py index 2edaff946..4304a6baf 100644 --- a/tests/client/test_auth.py +++ b/tests/client/test_auth.py @@ -756,7 +756,8 @@ async def test_async_auth_flow_no_token(self, oauth_provider): # No Authorization header should be added if no token assert "Authorization" not in updated_request.headers - def test_scope_priority_client_metadata_first( + @pytest.mark.anyio + async def test_scope_priority_client_metadata_first( self, oauth_provider, oauth_client_info ): """Test that client metadata scope takes priority.""" @@ -785,7 +786,8 @@ def test_scope_priority_client_metadata_first( assert auth_params["scope"] == "read write" - def test_scope_priority_no_client_metadata_scope( + @pytest.mark.anyio + 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."""