Skip to content

fix: add missing TYPE_CHECKING guard in tests#1197

Merged
henryiii merged 2 commits into
pypa:mainfrom
mayeut:missing-type-checking-guard
May 26, 2026
Merged

fix: add missing TYPE_CHECKING guard in tests#1197
henryiii merged 2 commits into
pypa:mainfrom
mayeut:missing-type-checking-guard

Conversation

@mayeut
Copy link
Copy Markdown
Member

@mayeut mayeut commented May 25, 2026

typing_extensions is not part of the test dependency group.
When re-using an existing environment for Python 3.9 tests (default with the current noxfile), tests might fail at collection time because of the missing typing_extensions module. I did run into this.

When looking at all typing_extensions usage, TypeGuard import at runtime depended on the Python version so moved the whole block under the if TYPE_CHECKING: block for consistency.

mayeut added 2 commits May 25, 2026 16:40
`typing_extensions` is not part of the test dependency group. When re-using an existing environment for Python 3.9 tests (default with the current noxfile), tests might fail at collection time because of the missing `typing_extensions` module.
@henryiii henryiii force-pushed the missing-type-checking-guard branch from e93fdfc to 7286e75 Compare May 25, 2026 20:40
@henryiii henryiii merged commit b1b483c into pypa:main May 26, 2026
107 of 109 checks passed
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.

3 participants