-
-
Notifications
You must be signed in to change notification settings - Fork 948
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
add basic timeout support for testclient #1109
Conversation
raise ValueError if user submits tuple simplify by removing inline function typing updates
Wondering if there's anything more to do for this? Thanks. |
Hey 👋 this seems like a reasonable change, but I have a couple of questions/points:
|
|
Hi @falkben! 👋 Would you mind rebasing it? |
I started this process in a diff branch but unclear where to put something like |
My approval was given before being part of encode. The solution is not anyio compliant, so we need to check how to proceed here.
I'm not convinced we necessarily want timeout behaviour in the test client, but either way around it's probably not great timing given #1376 - might make sense to consider this only after that's in? |
I'm going to put on my maintainer-pushback hat here and say "the TestClient doesn't support timeouts". Existing WSGI frameworks haven't generally supported this, and needing them almost certainly points to flaky tests. I'd be up for docs pull requests around this if anyone's motivated to do so. |
Closes #1108
Note, this does not implement the separate
connection
andread
timeouts thatrequests
supports (will raise aValueError
if user supplies atuple
. Besides the added complexity of dealing with that, it also didn't make sense to me that there would be a connection timeout when testing a local mounted app.Not sure if something is needed in the docs about timeout, but maybe I could if desired? https://github.com/encode/starlette/blob/ben%2Ftestclient_timeout/docs/testclient.md