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,
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