Skip to content

Commit 84e7e47

Browse files
committed
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.
1 parent 05b7156 commit 84e7e47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/client/test_auth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,8 @@ async def test_async_auth_flow_no_token(self, oauth_provider):
756756
# No Authorization header should be added if no token
757757
assert "Authorization" not in updated_request.headers
758758

759-
def test_scope_priority_client_metadata_first(
759+
@pytest.mark.anyio
760+
async def test_scope_priority_client_metadata_first(
760761
self, oauth_provider, oauth_client_info
761762
):
762763
"""Test that client metadata scope takes priority."""
@@ -785,7 +786,8 @@ def test_scope_priority_client_metadata_first(
785786

786787
assert auth_params["scope"] == "read write"
787788

788-
def test_scope_priority_no_client_metadata_scope(
789+
@pytest.mark.anyio
790+
async def test_scope_priority_no_client_metadata_scope(
789791
self, oauth_provider, oauth_client_info
790792
):
791793
"""Test that no scope parameter is set when client metadata has no scope."""

0 commit comments

Comments
 (0)