-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Set Client.as_current when entering ctx #6527
Conversation
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 15 files ±0 15 suites ±0 6h 33m 35s ⏱️ + 8m 3s For more details on these failures and errors, see this check. Results for commit e7337a4. ± Comparison against base commit ea2c80f. |
e7337a4
to
36a50d7
Compare
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 20 files 20 suites 11h 5m 53s ⏱️ For more details on these failures, see this check. Results for commit 2538ac1. ♻️ This comment has been updated with latest results. |
36a50d7
to
5046fb9
Compare
c = await Client(s.address, asynchronous=True) | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we can only set current when entering ctx when set_as_default
is also set. Otherwise this breaks tests like this.
That also makes sense considering that default_client
and Client.current
are effectively aliases
…nstead_of_default
this fixes test_client.py::test_default_get and test_client.py::test_Future_exception_sync_2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a trivial nitpick
751f2ca
to
2538ac1
Compare
Most of the time we actually prefer using the current client and not the default client. Whenever we're using the client in a ctx manager, we should set the current client
TODO: tests
cc @graingert