In tests, we can see a lot of code like:
obj2 = something() obj_orig = self.engine_1.remote self.engine_1.remote = obj2 # ... testings self.engine_1.remote = obj_orig
This is error prone as sometimes we do not restore the original object.
Also we should leverage the powerful unittest.mock.patch() function for those usages.
It will assure us less random bugs in some places.