Replies: 2 comments 1 reply
|
ran your snippet through pyrefly 1.2.0, mypy 1.19.1 and pyright: all three stay silent, while a plain str-into-int control errors in all three. pytest resolves fixtures by name at runtime, so there's no call site to compare the annotation against. #3776 tracks adding that inference. side note, without a |
1 reply
|
I don’t think there's special type checking for pytest yet, iirc the pytest support we currently have is mostly around code navigation, but we are not opposed to adding this support |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have this simple dumb test.
In Python, this is 100% valid typing, but not with the Pytest dependency injection mecanism. The fixture
my_fixtureshould be annotated asstr.I know Pyrefly has built-in support for Pytest, but does that include checking fixture type errors? In my case, it is not raising any error on this code.
It's not clear from the documentation, so I don't want to raise an issue right away. Thanks!
All reactions