Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document global allow_net_connect flag #461

Open
thigg opened this issue Nov 14, 2022 · 1 comment
Open

Document global allow_net_connect flag #461

thigg opened this issue Nov 14, 2022 · 1 comment

Comments

@thigg
Copy link

thigg commented Nov 14, 2022

I haven't found any place in the documentation where it is mentioned, that it is possible to globally disable network access:

HTTPretty.allow_net_connect = False

I also didn't find a good place to add it, thus I am leaving this issue here.

@jamesL92
Copy link

From a quick look I'm not sure it's generally a good idea to set allow_net_connect directly - but rather should be set via HTTPretty.enable(allow_net_connect=False). Calling it this way monkeypatches some of python's socket implementation with a fake socket.

So I guess probably better not to add documentation to show that, as it would potentially encourage bad practice and potentially more buggy usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants