[MERGE] Discard most of TestCase instances __dict__ after successful tests to reduce memory consumption
John Arbash Meinel
john at arbash-meinel.com
Tue Feb 19 15:15:39 GMT 2008
John Arbash Meinel has voted tweak.
Status is now: Conditionally approved
Comment:
This seems a very odd idiom:
+ if getattr(test, '_log_contents', '') != '':
+ del test._log_contents
If the log contents is not the empty string, then delete it. Why not
just do:
test._log_contents = ''
So that you still have the attribute, and you just free the memory?
This:
+ if attr is not not_found:
The "is not not_found" is a bit hard to parse, though I'm guessing there
isn't a lot of choice here.
For details, see:
http://bundlebuggy.aaronbentley.com/request/%3C20080219132323.GF32582%40steerpike.home.puzzling.org%3E
More information about the bazaar
mailing list