Fabio Zadrozny <[email protected]> added the comment:
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 :)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11798>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com