Message9656
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. |
|
Date |
User |
Action |
Args |
2015-03-15 20:54:44 | stefan.richthofer | set | messageid: <1426452884.35.0.632316554577.issue2288@psf.upfronthosting.co.za> |
2015-03-15 20:54:44 | stefan.richthofer | set | recipients:
+ stefan.richthofer, zyasoft, Arfrever |
2015-03-15 20:54:44 | stefan.richthofer | link | issue2288 messages |
2015-03-15 20:54:43 | stefan.richthofer | create | |
|