Is there a good way to block network request withi...
# general
c
Is there a good way to block network request within a test in pants? We want to force dev's to always mock things out and was wondering if there was a easy way to do this. The concern is that building the pytest pex file could reach out over network so would fail.
f
h
That looks promising. I don't know of any way for Pants itself to turn off network access
f
another way would be to use the
sys.audit
mechanism to trap socket audit events and raise an exception to abort the operation. https://docs.python.org/3/library/sys.html#sys.addaudithook
👍 1
c
This is perfect