Skip to content

Scope Name Change Issue#14325

Merged
nicoddemus merged 7 commits intopytest-dev:mainfrom
JuliaKnaak:scope-name-change
Apr 1, 2026
Merged

Scope Name Change Issue#14325
nicoddemus merged 7 commits intopytest-dev:mainfrom
JuliaKnaak:scope-name-change

Conversation

@JuliaKnaak
Copy link
Copy Markdown
Contributor

@JuliaKnaak JuliaKnaak commented Mar 25, 2026

Closes Issue #14137

Description

This PR addresses the type scope callable issue reported in #14137. We implemented the suggested fix from the issue thread by updating the type signature for the scope parameter. Specifically, we expanded the type hints to allow dynamic scope callables to return a standard str in addition to ScopeName.

Verification & Testing

To verify the fix, our team replicated the original issue and tested the changes locally in our virtual environment:

  1. Replication: We created a minimal reproducible example (test.py) featuring a dynamic scope function (determine_my_client_scope) being passed to @pytest.fixture(scope=...).
image
  1. Initial Error: Running basedpyright test.py against the unmodified repository successfully reproduced the reportArgumentType error, complaining that a callable returning str was not assignable to ScopeName | ((str, Config) -> ScopeName).
image
  1. Validation: After applying the fix to the repository, we re-ran basedpyright test.py. The type checker now passes cleanly with 0 errors, 0 warnings, 0 notes.
image

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Mar 25, 2026
@JuliaKnaak JuliaKnaak marked this pull request as ready for review March 29, 2026 22:19
Removed commented-out code for check_scope_name_type function.
Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks, appreciate it!

@nicoddemus nicoddemus enabled auto-merge (squash) April 1, 2026 15:20
@nicoddemus nicoddemus merged commit f93656d into pytest-dev:main Apr 1, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants