The patches here are done with a context manager and while the name exists outside of the context, the context has been exited (actually--both contexts have been exited), so I maintain that this is weird generally and with some/many context managers problematic. I wouldn't have done it this way.

Having said that, I agree with minimizing mocking time.

If you want to keep it this way, that's ok with me.