Skip to content

Conversation

nandsha
Copy link
Contributor

@nandsha nandsha commented May 31, 2025

Description

This PR fixes test failures in test_auth.py where two synchronous test methods were incorrectly using an async fixture.

Problem

Two test methods 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'

Solution

Added @pytest.mark.anyio decorator and converted both methods to async def, following the pattern established in commit 9dad266.

Testing

  • ✅ Both fixed tests now pass
  • ✅ All tests pass locally (except one unrelated flaky test)
  • ✅ Linting passes (uv run ruff check)
  • ✅ Formatting checked (uv run ruff format)
  • ✅ Type checking passes (uv run pyright)

Note

The CI currently has continue-on-error: true for tests, which is why these failures weren't caught. This might be worth addressing in a separate issue.

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.
@nandsha nandsha marked this pull request as ready for review May 31, 2025 07:09
@nandsha nandsha closed this by deleting the head repository Jun 8, 2025
@nandsha
Copy link
Contributor Author

nandsha commented Jul 7, 2025

Had replaced this PR with #903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant