Message9656

Author stefan.richthofer
Recipients Arfrever, stefan.richthofer, zyasoft
Date 2015-03-15.20:54:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426452884.35.0.632316554577.issue2288@psf.upfronthosting.co.za>
In-reply-to
Content
It seems, an exception in a finalizer usually does not cause a test to fail:

class GCTests_Finalization_Exception(unittest.TestCase):

    def test1(self):
        class A:
            def __del__(self):
                print "A __del__"
                A.txt = "text1"
                GCTestHelper.causeNullPointerException()
                A.txt = "text2"

        a = A()
        del a
        gc.collect()
        time.sleep(1)
        print "collect done"
        print A.txt
        self.assertEqual(A.txt, "text1")
        ts = Py.getThreadState()
        print ts.exception


Output is:

A __del__
Exception java.lang.NullPointerException: java.lang.NullPointerException in <bound method A.__del__ of <__main__.A instance at 0x2>> ignored
collect done
text1
None
.
----------------------------------------------------------------------
Ran 1 test in 1.209s

OK

So...
either NPE in __del__ is not the cause for the failure or things work different in the Sphinx test suite (maybe the issue only manifests with nose-testing). I will investigate this further.
History
Date User Action Args
2015-03-15 20:54:44stefan.richthofersetmessageid: <1426452884.35.0.632316554577.issue2288@psf.upfronthosting.co.za>
2015-03-15 20:54:44stefan.richthofersetrecipients: + stefan.richthofer, zyasoft, Arfrever
2015-03-15 20:54:44stefan.richthoferlinkissue2288 messages
2015-03-15 20:54:43stefan.richthofercreate