TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: HTTPretty, an easy way to mock http requests in python

97 pointsby gfalcaoover 12 years ago

8 comments

leftnodeover 12 years ago
I'm just getting start with Python and was using the Requests library this morning. I didn't like that my tests were coupled to both the library and an Internet connection existing.<p>This just hits the frontpage today and it is exactly what I'm looking for. Thank you!
评论 #4764958 未加载
zer01over 12 years ago
Hot damn, this makes testing easy. Thanks a lot for the module! There's a small typo in your page. "HTTPretty monkey matches" should be "HTTPretty monkey patches".<p>Great job though!
评论 #4764937 未加载
kevin1024over 12 years ago
I'm working on a HTTP testing library based on Ruby's VCR library[1]. I've got it to a pretty basic state where it is somewhat usable. I'm definitely interested in this area. Ruby's VCR uses the Webmock library as a backend (though it can use other pluggable backends) to mock out all the HTTP requests. I had to sort of grow my own Webmock - maybe I can integrate HTTPretty instead so we don't duplicate effort.<p>[1]: <a href="http://www.github.com/kevin1024/vcrpy/" rel="nofollow">http://www.github.com/kevin1024/vcrpy/</a>
评论 #4766435 未加载
xvolterover 12 years ago
Oh wow, this could turn out to be very useful. Can use this for automated testing for public APIs.
评论 #4765129 未加载
bryanhover 12 years ago
Wonderful, was considering writing this just the other day. Thank you good sir.<p>One thing that would be <i>really</i> nice, is a record mode and serialization (to JSON/yaml/etc...) plus a context manager (python's with). How ready are you for pull requests? ;-)
评论 #4765330 未加载
emillonover 12 years ago
Fantastic, I tried to roll my own a few times but never got to this point. Thanks !
评论 #4764960 未加载
maakover 12 years ago
Very useful. Thank-you.
denzil_correaover 12 years ago
Great! I always used to have a fixed set of functions written in my personal code base todo these things. Glad yo know you have made a generic library. Good job.