Repository navigation
Conversation
When socket is disabled, disable these address lookups as well.
|
Thanks @shaleh ! Looks interesting. Please take a look at the failure and see if you can resolve? I'd also appreciate a new test case for each of the specific sockets being added, since I think the logic will apply to all sockets equally, so if one is blocked, all would be blocked, so the tests should explicitly ensure that if something is calling |
|
@miketheman no problem. I did not put a ton of time in case the implementation was not the desired approach. Happy to ensure tests pass and are as desired. |
|
I am more accustomed to a tox based test world so I do not need to install the tooling in my own environment. I did not see a clean way to test this project as is. |
|
Fun, works on Linux (where I experimented) and fails everywhere else. |
|
Code Climate has analyzed commit 69321a6 and detected 0 issues on this pull request. View more on Code Climate. |
`--disable-socket` (and the marker/fixture) now guards `socket.getaddrinfo` and `socket.gethostbyname` too. Before this, a test could quietly resolve a hostname with sockets blocked, so "no network" wasn't really no network. The error names the call that got caught (`socket.socket`, `socket.getaddrinfo`, `socket.gethostbyname`) so failures point at the right one. Restoration is identity-checked: we only swap a function back if our guard is still the one in place. The resolution-cache tests monkeypatch `socket.getaddrinfo` themselves, and without that check each inner pytester teardown would stomp the outer monkeypatch. Closes #43. Supersedes #64. Signed-off-by: Mike Fiedler <[email protected]>
|
Superseded by #482 |
When socket is disabled, disable these address lookups as well.
Addresses #43