-
-
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
Add SSL related params to ClientSession.request #2184
Conversation
Having issues with too much mocking.... if someone has any advice? |
I suggest the following:
Feel free to ask if my recommendation is not clean. P.S. |
P.P.S. |
Obviously it's up to you: use free form or file all template fields if template is more comfortable to you. |
Regarding to proxy tests: take a look on |
@asvetlov PR template is very fine for me :) it helped me a lot to not forget anything (documentation and change logs especially) but thx I will have to change a few (all?) tests that mock the entire ClientRequest class. This thing is settings properties in the ClientRequest that I don't want. |
Are you talking about proxy tests which should be affected by the PR, not fingerprint related tests, right? In this case please don't hesitate to update all mocks if method signatures changed. I see no way to do it better. |
Yes at this point the code I did should have kept the original behavior intact and the tests should pass unchanged. But 3 of the 4 failures are due to the fact that the mocking is actually giving a fingerprint to the ClientRequest objects. |
Please update failed mocks, it's totally correct. |
06f5bbc
to
fd1547b
Compare
0a50695
to
3ba69a5
Compare
@cecton would you continue work on the PR? |
@asvetlov it shouldn't have take that much time but I got stuck with the mocking thing and then I had a lot of changes recently (change of project basically). I was going to ask for help with the tests actually. |
90b624b
to
fc19160
Compare
Codecov Report
@@ Coverage Diff @@
## master #2184 +/- ##
==========================================
+ Coverage 97.31% 97.33% +0.01%
==========================================
Files 39 39
Lines 7945 7993 +48
Branches 1378 1387 +9
==========================================
+ Hits 7732 7780 +48
Misses 90 90
Partials 123 123
Continue to review full report at Codecov.
|
08433b4
to
7f0948c
Compare
@asvetlov okay ready for review |
Looks good. Feel free to merge, while I very appreciate full test coverage. |
@asvetlov Thanks I will improve that! I thought I had all the cases but I hadn't check the diff on codecov. |
Just a hint: install codecov browser extension: https://docs.codecov.io/v4.3.6/docs/browser-extension |
0b08900
to
b844b26
Compare
that is nice trick! |
953118e
to
69bf0a5
Compare
aiohttp/client_reqrep.py
Outdated
if not hashfunc: | ||
raise ValueError('fingerprint has invalid length') | ||
elif hashfunc is md5 or hashfunc is sha1: | ||
warnings.simplefilter('always') |
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.
Wouldn't this cause suddenly global side effect?
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.
I have no idea. I copy-pasted that from there a610cf1
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.
I think you're right. After this the "warning filter specifications" is altered. https://docs.python.org/3.5/library/warnings.html#warnings.simplefilter @asvetlov can you confirm you want to keep this behavior?
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.
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.
I suppose I change the one in connector too? ^_^
69bf0a5
to
05890fa
Compare
What are you talking about? |
aiohttp/client_reqrep.py
Outdated
if not hashfunc: | ||
raise ValueError('fingerprint has invalid length') | ||
elif hashfunc is md5 or hashfunc is sha1: | ||
warnings.simplefilter('always') |
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.
@asvetlov codecov browser extension, very usefull |
@jettify thanks |
b07beb3
to
1143a08
Compare
@asvetlov I just saw that the original ticket mention a "move" of those parameters. She I implement a deprecation for the using the parameter in the connector? |
I not sure. |
@asvetlov the fingerprint is something you will get per server basis so per request makes sense. On the other hand the connector has the argument fingerprint like it would connect always to the same server. To me it doesn't make any sense. Unless maybe for a UNIX socket?
|
6f0c650
to
5fe5d46
Compare
5fe5d46
to
fb470f6
Compare
Make sense |
Thank you! |
What do these changes do?
...
Are there changes in behavior for the user?
...
Related issue number
#1128
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.