kiwicom / pytest-recording

A pytest plugin that allows recording network interactions via VCR.py
MIT License
441 stars 35 forks source link

[FEATURE] Tap into additional vcr_config parameters in block_network for allowed_hosts #73

Open AndreCimander opened 3 years ago

AndreCimander commented 3 years ago

This is kinda a chimeric issue. Related to my https://github.com/kiwicom/pytest-recording/issues/68, block_network should also have the option to set allowed_hosts via vcr_config, imho.

But then I thought "aren't the ignore_localhost and ignore_hosts parameters from the vcr_config basically the same as allowed_hosts?". VCRpy is adding localhost, 0.0.0.0 and 127.0.0.1 if ignore_localhostis truthy, and also adds ignore_hosts to the set.

I think it would make for a more seamless integration with vcrpy if allowed_hosts is also using ignore_localhost and ignore_hosts from the vcr_config to construct the list while retaining backwards compatibility :-)