Ronald Oussoren avatar Ronald Oussoren committed 330cfa6

Also revert changes to the unittests.

Comments (0)

Files changed (3)

Lib/objc/test/test_keyvalue.py

         # Check for using KVO in python.
 
         def testAutomaticObserving(self):
-            outer_pool = NSAutoreleasePool.alloc().init()
             observer = PyObjCTestObserver.alloc().init()
             o = PyObjCTestObserved2.alloc().init()
             pool = NSAutoreleasePool.alloc().init()
 
             before = DEALLOCS
             del o
-            del outer_pool
             self.assertEquals(DEALLOCS, before+1, u"Leaking an observed object")
 
         def testObserving(self):
-            pool = NSAutoreleasePool.alloc().init()
             observer = PyObjCTestObserver.alloc().init()
 
             o = PyObjCTestObserved1.alloc().init()
 
             before = DEALLOCS
             del o
-            del pool
             self.assertEquals(DEALLOCS, before+1, u"Leaking an observed object")
 
         def testObserving2(self):

Lib/objc/test/test_leaks.py

         LeaksDel = 0
         self.assertEquals(LeaksDel, 0)
 
-        pool = NSAutoreleasePool.alloc().init()
         o = LeaksClass.alloc().init()
         self.assert_(o is not None)
         self.assertEquals(LeaksDel, 0)
         del o
-        del pool
         self.assertEquals(LeaksDel, 1)
 
     def testOCClass1(self):

Lib/objc/test/test_subclass.py

             def __del__(self):
                 aList.append('__del__')
 
-        pool = NSAutoreleasePool.alloc().init()
         del aList[:]
         o = ClassWithRetaining.alloc().init()
         v = o.retainCount()
         self.assertEquals(aList, ['retain', 'release'])
         self.assertEquals(o.retainCount(), v)
         del o
-        del pool
 
         self.assertEquals(aList, ['retain', 'release', 'release', '__del__'])
 
         
         self.assertEquals(aList, ['retain', 'release', 'release', '__del__'])
 
-        pool = NSAutoreleasePool.alloc().init()
         class ClassWithRetainCount(NSObject):
             def retainCount(self):
                 aList.append('retainCount')
         self.assert_(isinstance(v, int))
         self.assertEquals(aList, ['retainCount'])
         del o
-        del pool
 
     def testOverrideDealloc(self):
         aList = []
                 return super(ClassWithDealloc, self).dealloc()
 
         del aList[:]
-        pool = NSAutoreleasePool.alloc().init()
         o = ClassWithDealloc.alloc().init()
         self.assertEquals(aList, [])
         del o
-        del pool
         self.assertEquals(len(aList), 2)
         self.assert_('dealloc' in aList)
         self.assert_('__del__' in aList)
                 return super(SubClassWithDealloc, self).dealloc()
 
         del aList[:]
-        pool = NSAutoreleasePool.alloc().init()
         o = SubClassWithDealloc.alloc().init()
         self.assertEquals(aList, [])
         del o
-        del pool
         self.assertEquals(len(aList), 3)
         self.assert_('dealloc.dealloc' in aList)
         self.assert_('dealloc' in aList)
                 aList.append('mydel')
 
         del aList[:]
-        pool = NSAutoreleasePool.alloc().init()
         o = ClassWithDeallocAndDel.alloc().init()
         self.assertEquals(aList, [])
         del o
-        del pool
         self.assertEquals(len(aList), 3)
         self.assert_('mydel' in aList)
         self.assert_('dealloc' in aList)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.