1from PyObjCTools.TestSupport import * 2import objc 3 4from Foundation import * 5 6class TestNSAutoreleasePoolInteraction(TestCase): 7 8 def testNSAutoreleasePoolPlain(self): 9 pool = NSAutoreleasePool.alloc().init() 10 bar = NSMutableArray.array() 11 del pool # Always use 'del pool' instead of 'pool.release()'! 12 bar.addObject_( b"a".decode('ascii') ) # should still exist because of python GC 13 14if __name__ == '__main__': 15 main( ) 16