Open BenjamenMeyer opened 9 years ago
Per #254, it seems like this might only be a problem with HTTPS, at least with eventlet/gevent. We use HTTPretty through moto, and once we started connecting with is_secure=False
, we were able to use gevent + HTTPretty.
Glad you found a solution for gevent, however, asyncio/aiohttp is a different issue. There just isn't any really any project that does to asyncio/aiohttp project what httypretty does to standard sockets.
FWIW, I started my own variant targetted at Python3 and asyncio/aiohttp - https://github.com/TestInABox/aiohttp-mock - still working out some of the details, but the interface should be generally compatible, and help is welcomed.
Note: Updated the URL b/c I moved the projects into their own org.
Mocket supports both gevent
and asyncio
/aiohttp
.
https://pypi.python.org/pypi/mocket/2.0.0
@mindflayer thanks for the info on that; I'll take a look at it for another project (https://pypi.python.org/pypi/stackinabox) which provides built-in suport for HTTpretty among others.
It would be great if there was support for monkey patching Python3's asyncio, gevent, and other similar libs as these are becoming more popular. Python3's asyncio should be doable if socketpair was also monkey patched.