Don't mock Python's HTTPX
Briefly

It didn't set up any sort of timeout by default, which meant you had to remember to do it explicitly (and quite a few linters will flag use of requests without an explicit timeout, if you're worried about it). It's synchronous/blocking-only, which doesn't play as nicely with the current wave of async Python libraries, frameworks, and other tools.
HTTPX provides both sync and async support, a default timeout, and a pile of other features, and with a largely requests-compatible API requiring only minimal code changes to adopt. So I've been gradually switching my own projects over to it for a while now.
But there's something I wish I'd learned a lot earlier, and so I'll share it with you now in case it's also something you will end up wishing you'd learned earlier, or glad that you did learn early: don't mock HTTPX.
Read at B-list
[
add
]
[
|
|
]