Skip to content

Commit a2643d3

Browse files
committed
fix failing tests
1 parent 5441767 commit a2643d3

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

tests/client/test_auth.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def test_generate_code_verifier(self, oauth_provider):
143143
verifiers = {oauth_provider._generate_code_verifier() for _ in range(10)}
144144
assert len(verifiers) == 10
145145

146-
def test_generate_code_challenge(self, oauth_provider):
146+
@pytest.mark.anyio
147+
async def test_generate_code_challenge(self, oauth_provider):
147148
"""Test PKCE code challenge generation."""
148149
verifier = "test_code_verifier_123"
149150
challenge = oauth_provider._generate_code_challenge(verifier)
@@ -161,7 +162,8 @@ def test_generate_code_challenge(self, oauth_provider):
161162
assert "+" not in challenge
162163
assert "/" not in challenge
163164

164-
def test_get_authorization_base_url(self, oauth_provider):
165+
@pytest.mark.anyio
166+
async def test_get_authorization_base_url(self, oauth_provider):
165167
"""Test authorization base URL extraction."""
166168
# Test with path
167169
assert (
@@ -348,11 +350,13 @@ async def test_register_oauth_client_failure(self, oauth_provider):
348350
None,
349351
)
350352

351-
def test_has_valid_token_no_token(self, oauth_provider):
353+
@pytest.mark.anyio
354+
async def test_has_valid_token_no_token(self, oauth_provider):
352355
"""Test token validation with no token."""
353356
assert not oauth_provider._has_valid_token()
354357

355-
def test_has_valid_token_valid(self, oauth_provider, oauth_token):
358+
@pytest.mark.anyio
359+
async def test_has_valid_token_valid(self, oauth_provider, oauth_token):
356360
"""Test token validation with valid token."""
357361
oauth_provider._current_tokens = oauth_token
358362
oauth_provider._token_expiry_time = time.time() + 3600 # Future expiry
@@ -756,7 +760,9 @@ async def test_async_auth_flow_no_token(self, oauth_provider):
756760
# No Authorization header should be added if no token
757761
assert "Authorization" not in updated_request.headers
758762

759-
def test_scope_priority_client_metadata_first(
763+
764+
@pytest.mark.anyio
765+
async def test_scope_priority_client_metadata_first(
760766
self, oauth_provider, oauth_client_info
761767
):
762768
"""Test that client metadata scope takes priority."""
@@ -785,7 +791,8 @@ def test_scope_priority_client_metadata_first(
785791

786792
assert auth_params["scope"] == "read write"
787793

788-
def test_scope_priority_no_client_metadata_scope(
794+
@pytest.mark.anyio
795+
async def test_scope_priority_no_client_metadata_scope(
789796
self, oauth_provider, oauth_client_info
790797
):
791798
"""Test that no scope parameter is set when client metadata has no scope."""

0 commit comments

Comments
 (0)