Repository navigation
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.
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
crusaderky
left a comment
There was a problem hiding this comment.
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