gabrielfalcao/HTTPretty — pull request #50 by timcowlishaw (2013-04-11 10:56:03+00:00)
Title: ensure that calls to the 'setblocking' method on fake sockets are delegated to the underlying socket

Hi there!

Great work on this, I'm working on a Python project at the moment, after years of doing BDD in Ruby, and it's great to see the tool support for BDD in python getting so good.

However, I ran into a slight problem when using HTTPretty to mock some external web service calls in lettuce acceptance tests for a webapp - if I set up my mocked HTTP endpoints, then spin up an instance of my webapp with paste, paste fails as the socket object it has has no setblocking method. Here's a little patch that fixes that by making sure the fake socket objects always proxy calls to this through to the underlying true socket.

Thanks for a really useful tool!

Cheers,

Tim