Closed larryweya closed 11 years ago
What I don't like is that currently whatever res
is, it will be lost. Could you make instead say something like:
elif res is None:
return None
else:
raise TypeError(…)
This should make debugging much easier if your mock returns a type that we don't know how to handle.
@patrys makes sense, I've updated the pull request to reflect.
Seems like the _real_session_send will never be reached since intercept always returns a valid Response object. Our use-case is that we want to be able to run the same test against the actual target server in which case we just modify the net-loc.