-
Notifications
You must be signed in to change notification settings - Fork 193
HTTP20Adapter.close tests (supersedes #307) #344
HTTP20Adapter.close tests (supersedes #307) #344
Conversation
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.
Thanks for this! It would be good if we could add a test that demonstrates that calling close
on the adapter both closes the underlying connections and also clears the connection cache. Mind adding those?
I've added that check to these two tests instead of creating a new one. Let me know if you think that this should be checked in a separate test. |
test/test_integration.py
Outdated
|
||
# check that all connections are actually closed | ||
assert (connections_before_close and | ||
all(conn._sock is None for conn in connections_before_close)) |
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.
Let's split the first assertion out and call it when we get the connections initially.
test/test_integration.py
Outdated
|
||
# check that all connections are actually closed | ||
assert (connections_before_close and | ||
all(conn._sock is None for conn in connections_before_close)) |
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.
Same note here.
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.
Very nice, this looks really good. Thanks so much!
Add
close()
method implementation to the requests adapter and integration tests for it.Supersedes #307
Related issue: #306