I'm trying to write a unit-test using pytest
and the class I'm testing is import
ing a type for another library which open a socket during it's import. The type itself is pretty simple, it only implements __call__
and return a plain-old-python-object that is easy to mock.
Is there a way I can monkey-patch that import so that the real python file will not get called before my test starts?