[issue31261] unittest fails to properly destruct objects created during setUp if a test fails

2017-08-22 Thread R. David Murray
R. David Murray added the comment: GC cleanup is not guaranteed to be synchronous. You are observing normal Python behavior here. Cleanup does not happen until the TestCase instance is finalized (thus eliminating the self.dummy reference to your DummyClass). In the case of passing tests,

[issue31261] unittest fails to properly destruct objects created during setUp if a test fails

2017-08-22 Thread Micah
New submission from Micah: When running the attached example test dummy objects are created during setUp and destructed at the end of a passing test but when a test fails the dummy object that was created in setUp fails to deconstruct. This leads to cascading errors when writing integration