You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we are trying to allow a specific test to allow sockets via the @pytest.mark.allow_hosts decorator. What we're noticing is that even if we allow specific hostnames (and we can see them in the allowed list stepping through the code), since socket.socket was already set as GuardedSocket, we get SocketBlockedError raised.
Is a way for us to accomplish this by disabling sockets globally, then allowing certain tests to bypass via allow_hosts decorator?
This discussion was converted from issue #354 on June 29, 2024 00:19.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
We are trying to disable socks globally via the following snippet in our conftest file:
This works as expected.
Now we are trying to allow a specific test to allow sockets via the
@pytest.mark.allow_hosts
decorator. What we're noticing is that even if we allow specific hostnames (and we can see them in the allowed list stepping through the code), sincesocket.socket
was already set asGuardedSocket
, we getSocketBlockedError
raised.Is a way for us to accomplish this by disabling sockets globally, then allowing certain tests to bypass via allow_hosts decorator?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions