[Python-Dev] Test cases not garbage collected after run (original) (raw)
Robert Collins robertc at robertcollins.net
Thu Apr 7 21🔞07 CEST 2011
- Previous message: [Python-Dev] Test cases not garbage collected after run
- Next message: [Python-Dev] Test cases not garbage collected after run
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Apr 8, 2011 at 4:49 AM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
You mean that the test run keeps the test instances alive for the whole test run so instance attributes are also kept alive. How would you solve this - by having calling a TestSuite (which is how a test run is executed) remove members from themselves after each test execution? (Any failure tracebacks etc stored by the TestResult would also have to not keep the test alive.)
My only concern would be backwards compatibility due to the change in behaviour.
An alternative is in TestCase.run() / TestCase.call(), make a copy and immediately delegate to it; that leaves the original untouched, permitting run-in-a-loop style helpers to still work.
Testtools did something to address this problem, but I forget what it was offhand.
-Rob
- Previous message: [Python-Dev] Test cases not garbage collected after run
- Next message: [Python-Dev] Test cases not garbage collected after run
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]