Skip to content

Conversation

chbndrhnns
Copy link
Contributor

Previously, the provider guarded type inference with context.maySwitchToAST(func) where func is the test function that declares the parameter. If that context couldn’t switch to AST for the actual fixture function’s file (commonly conftest.py), context.getReturnType(fixtureFunc) wouldn’t look into the fixture body, so the return type degraded to unknown.

Fixes https://youtrack.jetbrains.com/issue/PY-66245/Does-not-render-documentation-for-pytest-fixtures

Previously, the provider guarded type inference with context.maySwitchToAST(func) where func is the test function that declares the parameter. If that context couldn’t switch to AST for the actual fixture function’s file (commonly conftest.py), context.getReturnType(fixtureFunc) wouldn’t look into the fixture body, so the return type degraded to unknown.
@BartvHelvert BartvHelvert added the PyCharm Pull requests for PyCharm label Sep 6, 2025
@avokin2 avokin2 assigned EliseevEgor and unassigned avokin2 Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyCharm Pull requests for PyCharm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants