-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestClient.app can be None #7226
Comments
Please provide more information about the problem, The warning and error logs from mypy are ideal |
Let me know If you'd like to work on the issue, and I'll provide further guidance. This was partly just a note for me to come back to later. But, basically, as indicated above, it is typed as |
I'd like to work with that, but I don't know how to approach it.
I'm not sure if this is the right approach, I'd be glad if you could point me in the right direction |
OK, it looks like it's just Line 209 in 3ff81dc
So, following the current implementation, we could just make TestClient generic. If it's passed an instance of It might be nice to make |
So, yeah. If you want to do what you described above, as long as it doesn't cause a big headache in the tests, I think that's a good way to go. |
I returned to this issue again. We can just always return Application from TestClient.app and raise an error instead of None
However, this changes the behavior of the tests, this can be problematic |
Hmm, that could work. But, is there a problem with the previous proposal? |
I'm just trying to pick an approach that affects as few lines as possible and doesn't affect anything else. |
My thoughts were that these test servers are unlikely to be used directly by users often, so if making them generic improves accuracy/robustness of the code, then it seems like a good change. Let me know if you think I'm missing something though. |
A minor nuisance, but
TestClient.app
isApplication | None
.When type checking in mypy this results in a bunch of errors unless extra assert calls are made.
Maybe we can make it generic or similar, so when passing an Application to the aiohttp_client fixture, for example, it will know that the attribute will not be None.
The text was updated successfully, but these errors were encountered: