Skip to content

Commit ad59c92

Browse files
committed
Fix async fixture usage in OAuth tests
1 parent 5c87fb3 commit ad59c92

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/client/test_auth.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async def test_init(self, oauth_provider, client_metadata, mock_storage):
157157
assert oauth_provider.timeout == 300.0
158158

159159
@pytest.mark.anyio
160-
def test_generate_code_verifier(self, oauth_provider):
160+
async def test_generate_code_verifier(self, oauth_provider):
161161
"""Test PKCE code verifier generation."""
162162
verifier = oauth_provider._generate_code_verifier()
163163

@@ -175,7 +175,7 @@ def test_generate_code_verifier(self, oauth_provider):
175175
assert len(verifiers) == 10
176176

177177
@pytest.mark.anyio
178-
def test_generate_code_challenge(self, oauth_provider):
178+
async def test_generate_code_challenge(self, oauth_provider):
179179
"""Test PKCE code challenge generation."""
180180
verifier = "test_code_verifier_123"
181181
challenge = oauth_provider._generate_code_challenge(verifier)
@@ -194,7 +194,7 @@ def test_generate_code_challenge(self, oauth_provider):
194194
assert "/" not in challenge
195195

196196
@pytest.mark.anyio
197-
def test_get_authorization_base_url(self, oauth_provider):
197+
async def test_get_authorization_base_url(self, oauth_provider):
198198
"""Test authorization base URL extraction."""
199199
# Test with path
200200
assert (
@@ -370,12 +370,12 @@ async def test_register_oauth_client_failure(self, oauth_provider):
370370
)
371371

372372
@pytest.mark.anyio
373-
def test_has_valid_token_no_token(self, oauth_provider):
373+
async def test_has_valid_token_no_token(self, oauth_provider):
374374
"""Test token validation with no token."""
375375
assert not oauth_provider._has_valid_token()
376376

377377
@pytest.mark.anyio
378-
def test_has_valid_token_valid(self, oauth_provider, oauth_token):
378+
async def test_has_valid_token_valid(self, oauth_provider, oauth_token):
379379
"""Test token validation with valid token."""
380380
oauth_provider._current_tokens = oauth_token
381381
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):
780780
assert "Authorization" not in updated_request.headers
781781

782782
@pytest.mark.anyio
783-
def test_scope_priority_client_metadata_first(
783+
async def test_scope_priority_client_metadata_first(
784784
self, oauth_provider, oauth_client_info
785785
):
786786
"""Test that client metadata scope takes priority."""
@@ -810,7 +810,7 @@ def test_scope_priority_client_metadata_first(
810810
assert auth_params["scope"] == "read write"
811811

812812
@pytest.mark.anyio
813-
def test_scope_priority_no_client_metadata_scope(
813+
async def test_scope_priority_no_client_metadata_scope(
814814
self, oauth_provider, oauth_client_info
815815
):
816816
"""Test that no scope parameter is set when client metadata has no scope."""

0 commit comments

Comments
 (0)