Skip to content

Move scope step-up test to top-level function#2932

Merged
maxisbey merged 1 commit into
mainfrom
move-scope-step-up-test-to-top-level
Jun 20, 2026
Merged

Move scope step-up test to top-level function#2932
maxisbey merged 1 commit into
mainfrom
move-scope-step-up-test-to-top-level

Conversation

@Kludex

@Kludex Kludex commented Jun 20, 2026

Copy link
Copy Markdown
Member

Follow-up to #2931 addressing a review nit from this comment.

Per AGENTS.md, new tests should be plain top-level test_* functions, not methods of legacy Test* classes - even when added to a file that already contains them. test_403_step_up_preserves_scope_from_stored_token landed inside TestAuthFlow in #2931; this moves it out (drop self, dedent, keep @pytest.mark.anyio) to match the convention and its sibling test_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.

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.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@maxisbey maxisbey merged commit 3169922 into main Jun 20, 2026
33 checks passed
@maxisbey maxisbey deleted the move-scope-step-up-test-to-top-level branch June 20, 2026 17:45
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