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

feat(allow_hosts): add support for hostname resolution

Open Jguer opened this issue 4 years ago • 2 comments

Hey, thanks for the nice project.

Scenario I'm attempting to solve:

  • We have a service in our project we must connect to from a docker-composed application.
  • The hostname is stable but not the IP address.

Somewhat similar to #73

What does this MR do

  • Resolve allowed hostnames into IPs if possible and check if added exceptions are correct IPv4 addresses
  • Strip strings added to the list to make sure pytest --allow-hosts="172.18.0.2, 172.18.0.1" works

Questions

  • no checks for IPv6 addresses was done, is it relevant to readd?

If type hinting is necessary or some documentation needs to be changed feel free to ask.

Jguer avatar Nov 05 '21 15:11 Jguer

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

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Nov 05 '21 15:11 qlty-cloud-legacy[bot]

Any way this can get into a release? I think it would help a lot if you want to use this plugin with something like docker-compose.

tonycosentini avatar Mar 09 '22 07:03 tonycosentini

please, could we upgrade this PR and #73 and get them into a release? I could help if you give me instructions.

mgaitan avatar Jan 09 '23 12:01 mgaitan

Closed via #189

miketheman avatar Feb 02 '23 22:02 miketheman