Re: [Pyunit-interest] PyUnitTestBrowser - Memory leak
Brought to you by:
purcell
From: Phlip <ppl...@om...> - 2002-06-04 02:45:24
|
Alexander Garden sez: > Phlip wrote: > > Thanks for debugging the rest of this crud, but I un-crudded it for > > version 003. Please try http://flea.sourceforge.net/browser003.zip if you > > still have any enthusiasm left, but I should take a shift this evening. > > I knew I should have gotten the latest code before debugging! But, then I > wouldn't have had the fun and education of The Hunt. :) Not at all - I'm totally indebted to you for confirming the leak was in the area that I fixed, and that I should fix it again. (Funny how these programming bug hunts can always find meaning.) > This version seems to work fine. Memory usage doubled from 6 megs to 13, > but it doesn't seem to leak. Mem pumps when we call 'reload', and we now have a test for Debug.py. So the testor is in memory, and its copy of the testee, etc. > One complaint: > @@ -463,7 +490,7 @@ > def __init__(self, folder): > FolderNode.__init__(self, folder) > > - listage = glob.glob(os.path.join(folder, '*test*.py')) > + listage = glob.glob(os.path.join(folder, '*.py')) > listage.sort() > > I like the old line better. Sorry - that one was a request by an audience member. At work, our custom testrunner enforces a totally strict naming convention. But to appeal to a mass market I have to be less narrow. I envision a browserConfig.py where one tweaks such constants by applying or removing well-commented commented code. As this is my first foray into authoring a tool others must use and patch, I note with wry amusement how you take for granted the ability to "speak in diffs". ;-) > I commonly have a handful of helper scripts > lying around in my code directory, which, because of their temporary and > simple nature, don't have the body of the code wrapped up in a __name__ > == '__main__' if clause. So when I ran the new browser.py, it died when > importing these because sys.argv[1] was outside the range of the list. A colleague stumbled over this one, and so did I when I tossed all of idlefork into a sub directory. > Or even better, > + listage = sys.argv[1:] > and let the user choose the pattern and the shell the expansion. Oookay. Now make them enter this: $ ./browser.py test\*.py The slash is not optional because we don't want your BASH or whatever to expand the *. We need to expand it for you, recursively in each sub directory. Like 'find'. I will add this last suggestion to the do-list because it subsumes all the others. -- Phlip http://www.greencheese.org/ParodyMode -- The first few lines of code must "hook" the computer, and make it "care" about the program -- |