Open FichteFoll opened 3 months ago
Yeah, makes me cry that I have to set ruff to prefer the parenthesis 😢
I'm certain that it's an issue with pytest stubs, not with [based]mypy, the solutions I see are:
Any
ignoring rules where you can specify certain calls or something Any
s not report if object
can be used insteadi know! lets reuse untyped_calls_exclude
! perfect!
Describe the problem, ie expected/actual result (if it's not blatantly obvious)
When writing tests with pytest, any method decorated with
@pytest.fixture
causesno-any-expr
to be reported.Adding parentheses to the decorator, e.g. when defining
(autouse=True)
makes the error disappear because, most likely, another overload is matched. However, using just empty parentheses makes ruff report PT001, because this style is not recommended.This may or may not be a problem with the pytest type stubs but I'm not deep enough into typing to debug this myself.
Gist to reproduce
Basedmypy version
basedmypy 2.6.0 (compiled: yes) Based on mypy 1.11.1