You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: "NinjaResponse" has no attribute "__await__" [attr-defined]
Am I doing something wrong here - misunderstanding how this is supposed to work - or is this a real bug? Clearly the TestAsyncClient returns a coroutine when being utilised on an Async view, and also clearly no such __await__ method is defined. I would think that either:
Documentation needs to be improve to indicate proper usage, or
Stubs need to be improved to silence mypy
To be clear, there is no actual functional problem here. The test client works fine in the example above. It is purely that an error is thrown by mypy.
Running the following minimal example:
Produces the following mypy error:
Am I doing something wrong here - misunderstanding how this is supposed to work - or is this a real bug? Clearly the
TestAsyncClient
returns a coroutine when being utilised on an Async view, and also clearly no such__await__
method is defined. I would think that either:To be clear, there is no actual functional problem here. The test client works fine in the example above. It is purely that an error is thrown by mypy.
Relevant parts of mypy config:
Versions
python
: 3.12.8django
: 5.1.4django-ninja
: 1.3.0pydantic
: 2.10.3mypy
: 1.13.0django-stubs
: 5.1.1The text was updated successfully, but these errors were encountered: