Skip to content

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented May 27, 2025

We started running tests in parallel and this uncovered, strangely see this only in local run.

oauth_provider fixture in the test file is defined as an async fixture (async def oauth_provider), but two tests were trying to use it as a synchronous fixture:

  1. test_has_valid_token_expired - was a synchronous test (def test_...) but used the async oauth_provider fixture
  2. test_scope_priority_no_scope - was also a synchronous test but used the async oauth_provider fixture

This caused an AttributeError because pytest was passing a coroutine object instead of the actual OAuthClientProvider instance to these tests. When the tests tried to access attributes like oauth_provider._current_tokens, they failed because coroutine objects don't have these attributes.

The fix was to make both tests async by:

  • Adding @pytest.mark.anyio decorator
  • Changing def test_... to async def test_...

Also noticed that out CI does not catch ruff format so adding it here

@ihrpr ihrpr merged commit 9dad266 into main May 27, 2025
13 checks passed
@ihrpr ihrpr deleted the ihrpr/local-fixed branch May 27, 2025 16:00
saqadri pushed a commit to saqadri/stdio-fixes that referenced this pull request Aug 6, 2025
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.

2 participants