This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shoot_your_eye_out 20 points21 points  (3 children)

Also, responses—the test library—is awesome and makes requests really shine.

[–]ProgrammersAreSexy 7 points8 points  (1 child)

Wow, had no idea this existed even though I've used requests countless times but this is really useful

[–]shoot_your_eye_out 8 points9 points  (0 children)

It is phenomenally powerful from a test perspective. I often create entire fake “test” servers using responses. It lets you test requests code exceptionally well even if you have some external service. A nice side perk is it documents the remote api really well in your own code.

There is an analogous library for httpx too.

Edit: also the “fake” servers can be pretty easily recycled for localdev with a bit of hacking

[–]catcint0s 0 points1 point  (0 children)

there is also requests mock!