Move scope step-up test to top-level function#2932
Conversation
Per AGENTS.md, new tests should be plain top-level test_* functions, not methods of legacy Test* classes. test_403_step_up_preserves_scope_from_stored_token landed inside TestAuthFlow in #2931; move it out to match the convention and its sibling test_union_scopes.
There was a problem hiding this comment.
LGTM — mechanical move of a test from the legacy class to a top-level function, matching the convention in AGENTS.md.
Extended reasoning...
Overview
This PR touches a single test file, tests/client/test_auth.py. It relocates test_403_step_up_preserves_scope_from_stored_token (added in #2931 inside the legacy TestAuthFlow class) to a module-level test_* function, dropping self and dedenting the body. The test logic, assertions, and @pytest.mark.anyio marker are unchanged.
Security risks
None. No production code is modified — this is a test-only refactor of OAuth client tests; the underlying SEP-2350 behavior was already reviewed and merged in #2931.
Level of scrutiny
Low. The change is purely mechanical (a code move with no semantic difference). I verified that both fixtures the test depends on (oauth_provider, mock_storage) are defined at module level (tests/client/test_auth.py:66, :92), so fixture resolution is identical whether the test lives in the class or at the top level.
Other factors
The bug-hunting pass found no issues, and the PR directly addresses a reviewer nit from #2931 about following the repo's test-style convention. There are no outstanding reviewer comments on this PR.
Follow-up to #2931 addressing a review nit from this comment.
Per
AGENTS.md, new tests should be plain top-leveltest_*functions, not methods of legacyTest*classes - even when added to a file that already contains them.test_403_step_up_preserves_scope_from_stored_tokenlanded insideTestAuthFlowin #2931; this moves it out (dropself, dedent, keep@pytest.mark.anyio) to match the convention and its siblingtest_union_scopes. Both fixtures it uses are module-level, so it resolves identically.AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.