Is there a way to allow connection in all tests and only block at specific? #114
-
First of all, I'm new to pytest so sorry if I make a mistake. Thanks in advance |
Beta Was this translation helpful? Give feedback.
Answered by
miketheman
Jan 26, 2022
Replies: 1 comment
-
Hi @Guy-Markman ! def test_something(socket_disabled):
# do something in your test... And that ought to prevent network calls! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Guy-Markman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Guy-Markman !
Thanks for asking. The package provides pytest fixtures, that you can use to selectively disable network calls.
It would look something like this:
And that ought to prevent network calls!