Monkeypatching gevent's socket globally allows you to use libraries and drivers like pymongo off the shelf, and they will be non-blocking by default.
Not to mention that if you are using a c-extension monkey patching won't help much.
(I've worked on a lot of code that took the second trade-off. The result is almost always a full rewrite. Maintain your codebase or it goes out of control really fast.)
Nice one. That's a deep concept. Programmers and projects generally get themselves into trouble because of a misunderstanding of the trade-offs.
It's rookie programmers who are enamored with a new bit of tech, but don't understand the downsides. It's managers who have an inaccurate estimation of risks and so lack the confidence to make decisive moves.
This is why experience can be so valuable in the programming field. This is the only way to learn about the cost/benefit trade offs.
Maybe "facile" is a better term than "easy" for this, though.
with patch('path.to.object') as my_mock: my_mock.method.return_value = ...
also you can patch a module/class with a function.