This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fabioz
Recipients benjamin.peterson, exarkun, fabioz, michael.foord
Date 2011-04-07.17:11:42
SpamBayes Score 1.3894813e-10
Marked as misclassified No
Message-id <1302196302.8.0.705512619463.issue11798@psf.upfronthosting.co.za>
In-reply-to
Content
The current code I use in PyDev is below -- another option could be not adding the None to the list of tests, but removing it, but I find that a bit worse because in the current way if someone tries to access it after it's ran, it'll become clear it was removed.

def run(self, result):
    for index, test in enumerate(self._tests):
        if result.shouldStop:
            break
        test(result)

        # Let the memory be released! 
        self._tests[index] = None

    return result
    
    
I think the issue with the test result storing the test is much more difficult to deal with (because currently most unit test frameworks probably rely on having it there), so, that's probably not something I'd try to fix as it'd probably break many clients... in which case it should be expected that the test is kept alive if it fails -- but as the idea is that all has to turn green anyways, I don't see this as a big issue :)
History
Date User Action Args
2011-04-07 17:11:43fabiozsetrecipients: + fabioz, exarkun, benjamin.peterson, michael.foord
2011-04-07 17:11:42fabiozsetmessageid: <1302196302.8.0.705512619463.issue11798@psf.upfronthosting.co.za>
2011-04-07 17:11:42fabiozlinkissue11798 messages
2011-04-07 17:11:42fabiozcreate