-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow overriding ClientSession class in TestClient #2142
Conversation
ec5b7a4
to
87681c1
Compare
Sorry, I still don't understand why do you need to use custom client session. |
Codecov Report
@@ Coverage Diff @@
## master #2142 +/- ##
==========================================
+ Coverage 97.09% 97.09% +<.01%
==========================================
Files 38 38
Lines 7740 7741 +1
Branches 1351 1351
==========================================
+ Hits 7515 7516 +1
Misses 101 101
Partials 124 124
Continue to review full report at Codecov.
|
Really? I thought it was common usage. That's how docker-py works https://github.com/docker/docker-py/blob/master/docker/api/client.py#L44 I did the same for aiosparql: https://github.com/aio-libs/aiosparql/blob/master/aiosparql/client.py#L81 (In case of aiosparql I just did it because then I can use the |
@cecton looks like I've lost control onto aiohttp classes usage (again and again). But I see people inherit from session widely. The PR is good but please add a check for missed |
@asvetlov I can hardly test at that level because it's testing the test. But I will think of it... if you have any idea... :) |
The example 2 here could help http://www.programcreek.com/python/example/7163/unittest.expectedFailure Will do that |
Well, |
87681c1
to
5219adf
Compare
@asvetlov there is something fishy with the loop fixture that I will check another time. If I don't use the fixture loop, I can see this in the logs (by using
Not blocking though... just unclean. |
5219adf
to
0ffd9dd
Compare
@asvetlov I have the feeling the tests are run 3 times on travis... it takes ages compared to appveyor... something wrong too |
@asvetlov If you think one should not inherit from ClientSession, then maybe it's best to not encourage this behavior at all. Maybe it is best that we keep only the second commit which is simply handy and drop the first one. Anyone who really needs that will find their way to hack around to get it done anyway. |
Yes, the second commit only looks much better |
Closed in favor of #2151 |
What do these changes do?
It adds a keyword argument to the TestClient class to override the default ClientSession used.
Are there changes in behavior for the user?
None.
Related issue number
#2032 #2074
Checklist
CONTRIBUTORS.txt
changes
folder<issue_id>.<type>
for example (588.bug)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.