If you want to monkeypatch an object within a method, you currently have to:
SMTP = fudge.Fake()
rest of SMPT init
patched_smtplib = fudge.patch_object("smtplib", "SMTP", SMTP)
do your stuff
This works fine, but it can look a little cleaner, and always be properly restored, by using context managers and the with statement.
using the example above
with fudge.patch('smtplib', 'SMTP', SMTP):
# do your stuff
It's a pretty simple addition. I've included a changeset that adds this functionality.
I wasn't sure what minimum version of Python was supported (context managers were added in 2.5) so the new code fails gracefully if it's an older version of Python.