Пример #1
0
    def test_weakref_after_resurrection_threadsafe(self):
        gc.collect()

        prt = GCTestHelper.reflectionTraverseTestField()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestList()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestArray()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestPyList()
        del prt
        self.assertEqual(gc.collect(), 2)

        prt = GCTestHelper.reflectionTraverseTestCycle()
        del prt
        self.assertEqual(gc.collect(), 0)
Пример #2
0
    def test_TraverseByReflection(self):
        gc.collect()

        prt = GCTestHelper.reflectionTraverseTestField()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestList()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestArray()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestPyList()
        del prt
        self.assertEqual(gc.collect(), 2)

        prt = GCTestHelper.reflectionTraverseTestCycle()
        del prt
        self.assertEqual(gc.collect(), 0)
Пример #3
0
    def test_TraverseByReflection(self):
        gc.collect()

        prt = GCTestHelper.reflectionTraverseTestField()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestList()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestArray()
        del prt
        self.assertEqual(gc.collect(), 1)

        prt = GCTestHelper.reflectionTraverseTestPyList()
        del prt
        self.assertEqual(gc.collect(), 2)

        prt = GCTestHelper.reflectionTraverseTestCycle()
        del prt
        self.assertEqual(gc.collect(), 0)
Пример #4
0
 def test_Array(self):
     gc.collect()
     prt = GCTestHelper.reflectionTraverseTestArray()
     del prt
     self.assertEqual(gc.collect(), 1)
Пример #5
0
 def test_Array(self):
     gc.collect()
     prt = GCTestHelper.reflectionTraverseTestArray()
     del prt
     self.assertEqual(gc.collect(), 1)