Re: Mocking `from foo import *` functions

2009-01-10 Thread hsoft
On Jan 10, 4:19 pm, Rob Williscroft wrote: > Note that doing the above *before* any other module imports > from sender, will be sufficient in *any* case, though it won't > help if the tested code calls reload( sender ). Yeah, of course, but most of the time, you want to mock at the *test* level,

Re: Mocking `from foo import *` functions

2009-01-09 Thread hsoft
On Jan 10, 4:21 am, Silfheed wrote: > So I'm in the current testing situation: > > sender.py: > - > def sendEmails(): >    return "I send emails" > > alerter.py: > - > from sender import * > def DoStuffAndSendEmails(): >   doStuff() >   sendEmails() > > I'm trying to write

Re: Memoizing and WeakValueDictionary

2009-01-04 Thread hsoft
On Jan 4, 5:55 am, Paul McGuire wrote: > Just wanted to share some experience I had in doing some memory and > performance tuning of a graphics script.  I've been running some long- > running scripts on high-resolution images, and added memoizing to > optimize/minimize object creation (my objects