Re: [Pyunit-interest] PyUnitTestBrowser - Memory leak
Brought to you by:
purcell
From: Alexander G. <al...@in...> - 2002-06-04 02:33:22
|
On Mon, Jun 03, 2002 at 05:14:03PM -0700, 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. :) This version seems to work fine. Memory usage doubled from 6 megs to 13, but it doesn't seem to leak. 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. 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. And if one of these things didn't depend on something which would break when imported, as is sometimes the case, Bad Things could happen. Also I commonly rename old files something like old.program.py, which also breaks on import because the module old.program doesn't exist. Or even better, + listage = sys.argv[1:] and let the user choose the pattern and the shell the expansion. Alexander |