Add similar mock #326
Unanswered
RoelantStegmann
asked this question in
Q&A
Replies: 1 comment
-
While we don't yet have the exact behavior you're describing (using the Here's an example: from pytest_socket import disable_socket, enable_socket
...
def test_something()
# This runs with internet
...
disable_socket()
# This runs without
...
enable_socket()
# This should run with
... If you'd like to submit a patch with tests that implements the context manager protocol that does this, that'd be great! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I like this package, but now I need to only disable internet in part of my test - this way I can test if a certain caching method indeed prevents requests to pages, and thus will work when connection fails. I don't find in the docs if this is supported?
Beta Was this translation helpful? Give feedback.
All reactions