pytest-socket icon indicating copy to clipboard operation
pytest-socket copied to clipboard

Disable gethostbyname and getaddrinfo too.

Open shaleh opened this issue 4 years ago • 5 comments

When socket is disabled, disable these address lookups as well.

Addresses #43

shaleh avatar May 13 '21 23:05 shaleh

Thanks @shaleh ! Looks interesting. There's at least one test failure, as surfaced by the Actions. I'm not entirely sure why the rest were cancelled.

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 getaddrinfo() or gethostname() alone, that it's handled correctly

miketheman avatar May 13 '21 23:05 miketheman

@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.

shaleh avatar May 13 '21 23:05 shaleh

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.

shaleh avatar May 13 '21 23:05 shaleh

Fun, works on Linux (where I experimented) and fails everywhere else.

shaleh avatar May 13 '21 23:05 shaleh

Code Climate has analyzed commit 69321a66 and detected 0 issues on this pull request.

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Dec 23 '21 20:12 qlty-cloud-legacy[bot]