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 MCBama
Recipients MCBama, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-08-22.22:26:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503440760.72.0.06686224084.issue31261@psf.upfronthosting.co.za>
In-reply-to
Content
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 tests where having a "ghost" object sitting in the background and listening to messages is detrimental.

This behavior became apparent when I was writing integration tests making use of a signalling package so I pulled everything that wasn't base python to see if the bug was reproduced and it was. The object that failed to deconstruct when the test failed(0x000001CA971F6208) deconstructs at the end of the entire testcase while the object declared within the test function itself(0x000001CA971F62B0) deconstructs as soon as the test fails out.

The output of the test that I ran was this:

> python -m unittest test_bug.py


test_fail (test_bug.TestBug)
Created <test_bug.DummyClass object at 0x000001CA971F6208>
Created local <test_bug.DummyClass object at 0x000001CA971F62B0>
F
deleting <test_bug.DummyClass object at 0x000001CA971F62B0>


test_pass (test_bug.TestBug)
Created <test_bug.DummyClass object at 0x000001CA971F62B0>
.
deleting <test_bug.DummyClass object at 0x000001CA971F62B0>


test_passes (test_bug.TestBug)
Created <test_bug.DummyClass object at 0x000001CA971A5400>
.
deleting <test_bug.DummyClass object at 0x000001CA971A5400>

======================================================================
FAIL: test_fail (test_bug.TestBug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Code\test_bug.py", line 27, in test_fail
    self.assertTrue(False)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 3 tests in 0.004s

FAILED (failures=1)

deleting <test_bug.DummyClass object at 0x000001CA971F6208>
History
Date User Action Args
2017-08-22 22:26:00MCBamasetrecipients: + MCBama, paul.moore, tim.golden, zach.ware, steve.dower
2017-08-22 22:26:00MCBamasetmessageid: <1503440760.72.0.06686224084.issue31261@psf.upfronthosting.co.za>
2017-08-22 22:26:00MCBamalinkissue31261 messages
2017-08-22 22:26:00MCBamacreate