[PyObjC-svn] r2542 - in trunk/pyobjc/pyobjc-core: . Lib/PyObjCTools PyObjCTest

[email protected] Sun, 18 Jul 2010 04:29:29 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Sun Jul 18 04:29:29 2010
New Revision: 2542

Log:
Small test tweaks to ensure running with 2.6


Modified:
   trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dict_interface.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dictviews.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test3_dict_interface.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test3_typecheck.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleFunctions.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleVariables.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_ivar.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_locking.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata_function.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_methodaccess.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_methods.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_number_proxy.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_objc.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_protected.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_set_proxy.py
   trunk/pyobjc/pyobjc-core/PyObjCTest/test_subclass.py
   trunk/pyobjc/pyobjc-core/setup.py

Modified: trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	Sun Jul 18 04:29:29 2010
@@ -600,11 +600,11 @@
         if isinstance(value, types):
             self.fail(message or "%s is an instance of %r"%(value, types))
 
-    def assertIsIn(self, value, seq, message=None):
+    def assertIn(self, value, seq, message=None):
         if value not in seq:
             self.fail(message or "%r is not in %r"%(value, seq))
 
-    def assertIsNotIn(self, value, seq, message=None):
+    def assertNotIn(self, value, seq, message=None):
         if value in seq:
             self.fail(message or "%r is in %r"%(value, seq))
 
@@ -668,6 +668,10 @@
             return original_func(*args, **kwds)
         return deprecated_func
 
+    failUnlessIsIn = _deprecate(assertIn)
+    failUnlessIsNotIn = _deprecate(assertNotIn)
+    assertIsIn = _deprecate(assertIn)
+    assertIsNotIn = _deprecate(assertNotIn)
     failUnlessIsCFType = _deprecate(assertIsCFType)
     failUnlessIsOpaquePointer = _deprecate(assertIsOpaquePointer)
     failUnlessIsNone = _deprecate(assertIsNone)

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dict_interface.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dict_interface.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dict_interface.py	Sun Jul 18 04:29:29 2010
@@ -65,13 +65,13 @@
 
     def test_contains(self):
         d = NSMutableDictionary({})
-        self.assertIsNotIn('a', d)
+        self.assertNotIn('a', d)
         self.assertFalse('a' in d)
         self.assertTrue('a' not in d)
         d = NSMutableDictionary({'a': 1, 'b': 2})
-        self.assertIsIn('a', d)
-        self.assertIsIn('b', d)
-        self.assertIsNotIn('c', d)
+        self.assertIn('a', d)
+        self.assertIn('b', d)
+        self.assertNotIn('c', d)
 
         self.assertRaises(TypeError, d.__contains__)
 

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dictviews.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dictviews.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test2_dictviews.py	Sun Jul 18 04:29:29 2010
@@ -25,10 +25,10 @@
         self.assertNotEqual(keys, set([1, "b"]))
         self.assertNotEqual(keys, set([1]))
         self.assertNotEqual(keys, 42)
-        self.assertIsIn(1, keys)
-        self.assertIsIn("a", keys)
-        self.assertIsNotIn(10, keys)
-        self.assertIsNotIn("Z", keys)
+        self.assertIn(1, keys)
+        self.assertIn("a", keys)
+        self.assertNotIn(10, keys)
+        self.assertNotIn("Z", keys)
         self.assertEqual(d.viewkeys(), d.viewkeys())
         e = NSMutableDictionary({1: 11, "a": "def"})
         self.assertEqual(d.viewkeys(), e.viewkeys())
@@ -45,13 +45,13 @@
         self.assertNotEqual(items, set([(1, 10), ("a", "def")]))
         self.assertNotEqual(items, set([(1, 10)]))
         self.assertNotEqual(items, 42)
-        self.assertIsIn((1, 10), items)
-        self.assertIsIn(("a", "ABC"), items)
-        self.assertIsNotIn((1, 11), items)
-        self.assertIsNotIn(1, items)
-        self.assertIsNotIn((), items)
-        self.assertIsNotIn((1,), items)
-        self.assertIsNotIn((1, 2, 3), items)
+        self.assertIn((1, 10), items)
+        self.assertIn(("a", "ABC"), items)
+        self.assertNotIn((1, 11), items)
+        self.assertNotIn(1, items)
+        self.assertNotIn((), items)
+        self.assertNotIn((1,), items)
+        self.assertNotIn((1, 2, 3), items)
         self.assertEqual(d.viewitems(), d.viewitems())
         e = d.mutableCopy()
         self.assertEqual(d.viewitems(), e.viewitems())

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test3_dict_interface.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test3_dict_interface.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test3_dict_interface.py	Sun Jul 18 04:29:29 2010
@@ -43,10 +43,10 @@
         d = self.createDictionary(a=1, b=2)
         k = d.keys()
 
-        self.assertIsIn('a', d)
-        self.assertIsIn('b', d)
-        self.assertIsIn('a', k)
-        self.assertIsIn('b', k)
+        self.assertIn('a', d)
+        self.assertIn('b', d)
+        self.assertIn('a', k)
+        self.assertIn('b', k)
 
         self.assertIsNotInstance(k, list)
 
@@ -287,19 +287,19 @@
         d = self.createDictionary(a=1, b=2)
         k = d.keys()
 
-        self.assertIsIn('a', d)
-        self.assertIsIn('b', d)
-        self.assertIsIn('a', k)
-        self.assertIsIn('b', k)
+        self.assertIn('a', d)
+        self.assertIn('b', d)
+        self.assertIn('a', k)
+        self.assertIn('b', k)
 
         self.assertIsNotInstance(k, list)
 
-        self.assertIsNotIn('c', d)
-        self.assertIsNotIn('c', k)
+        self.assertNotIn('c', d)
+        self.assertNotIn('c', k)
 
         d['c'] = 3
-        self.assertIsIn('c', d)
-        self.assertIsIn('c', k)
+        self.assertIn('c', d)
+        self.assertIn('c', k)
 
     def testValuesMutable(self):
         d = self.createDictionary()

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test3_typecheck.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test3_typecheck.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test3_typecheck.py	Sun Jul 18 04:29:29 2010
@@ -30,7 +30,7 @@
         ]
         d = {}
         objc.loadBundleFunctions(bundle, d, tab)
-        self.assertIsIn('NSHomeDirectory', d)
+        self.assertIn('NSHomeDirectory', d)
 
 
         tab = [
@@ -53,7 +53,7 @@
 
         d = {}
         objc.loadBundleVariables(bundle, d, tab)
-        self.assertIsIn('NSAppleScriptErrorMessage', d)
+        self.assertIn('NSAppleScriptErrorMessage', d)
 
 
 

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleFunctions.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleFunctions.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleFunctions.py	Sun Jul 18 04:29:29 2010
@@ -23,9 +23,9 @@
         d = {}
         objc.loadBundleFunctions(self.bundle, d, FUNCTIONS)
 
-        self.assertIsIn('NSIsFreedObject', d)
-        self.assertIsIn('NSCountFrames', d)
-        self.assertIsIn('NSHomeDirectory', d)
+        self.assertIn('NSIsFreedObject', d)
+        self.assertIn('NSCountFrames', d)
+        self.assertIn('NSHomeDirectory', d)
 
         # Don't use this API, it is unsupported and causes warnings.
         #fn = d[u'NSIsFreedObject']

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleVariables.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleVariables.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_bundleVariables.py	Sun Jul 18 04:29:29 2010
@@ -13,8 +13,8 @@
                 ('NSBundleDidLoadNotification', b'@'),
             ])
 
-        self.assertIsIn(u'NSBundleDidLoadNotification', d)
-        self.assertIsIn(u'NSAppleScriptErrorMessage', d)
+        self.assertIn(u'NSBundleDidLoadNotification', d)
+        self.assertIn(u'NSAppleScriptErrorMessage', d)
 
         self.assertIsInstance(d[u'NSAppleScriptErrorMessage'], objc.pyobjc_unicode)
         self.assertIsInstance(d[u'NSBundleDidLoadNotification'], objc.pyobjc_unicode)
@@ -26,8 +26,8 @@
                 ('NSFoundationVersionNumber', objc._C_DBL),
             ])
 
-        self.assertIsIn('NSDebugEnabled', d)
-        self.assertIsIn('NSFoundationVersionNumber', d)
+        self.assertIn('NSDebugEnabled', d)
+        self.assertIn('NSFoundationVersionNumber', d)
 
         self.assertIsInstance(d['NSFoundationVersionNumber'], float)
         self.assertIsInstance(d['NSDebugEnabled'], int)

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_ivar.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_ivar.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_ivar.py	Sun Jul 18 04:29:29 2010
@@ -213,9 +213,9 @@
         # Note: cannot check the exact contents of dir(), who knows
         # what NSObject defines...
         v = objc.listInstanceVariables(obj)
-        self.assertIsIn(('charValue', objc._C_CHR), v)
-        self.assertIsIn(('intValue', objc._C_INT), v)
-        self.assertIsIn(('isa', objc._C_CLASS), v)
+        self.assertIn(('charValue', objc._C_CHR), v)
+        self.assertIn(('intValue', objc._C_INT), v)
+        self.assertIn(('isa', objc._C_CLASS), v)
 
     
     def testAnonymousIvar(self):

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_locking.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_locking.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_locking.py	Sun Jul 18 04:29:29 2010
@@ -97,7 +97,7 @@
 
         thr.join()
 
-        self.assertIsNotIn("LOCK FOUND", lst)
+        self.assertNotIn("LOCK FOUND", lst)
         for idx in range(len(lst)):
             if lst[idx].endswith(' a'):
                 self.assertTrue(lst[idx+1].endswith(' b'))
@@ -123,7 +123,7 @@
 
         thr.join()
 
-        self.assertIsNotIn("LOCK FOUND", lst)
+        self.assertNotIn("LOCK FOUND", lst)
         for idx in range(len(lst)):
             if lst[idx].endswith(' a'):
                 self.assertTrue(lst[idx+1].endswith(' b'))
@@ -155,7 +155,7 @@
 
         thr.join()
 
-        self.assertIsNotIn("LOCK FOUND", lst)
+        self.assertNotIn("LOCK FOUND", lst)
         for idx in range(len(lst)):
             if lst[idx].endswith(' a'):
                 self.assertTrue(lst[idx+1].endswith(' b'))

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata.py	Sun Jul 18 04:29:29 2010
@@ -920,18 +920,18 @@
     def testSuggestions(self):
         meta = OC_MetaDataTest.varargsMethodWithObjects_.__metadata__()
         self.assertIsInstance(meta, dict)
-        self.assertIsIn('suggestion', meta)
+        self.assertIn('suggestion', meta)
         self.assertEquals(meta['suggestion'], "Variadic functions/methods are not supported")
 
         meta = OC_MetaDataTest.ignoreMethod.__metadata__()
         self.assertIsInstance(meta, dict)
-        self.assertIsIn('suggestion', meta)
+        self.assertIn('suggestion', meta)
         self.assertEquals(meta['suggestion'], "please ignore me")
 
     def testPrintfFormat(self): 
         meta = OC_MetaDataTest.makeArrayWithFormat_.__metadata__()
         self.assertEquals(meta['variadic'], True)
-        self.assertIsNotIn('printf_format', meta['arguments'][0])
+        self.assertNotIn('printf_format', meta['arguments'][0])
         self.assertEquals(meta['arguments'][2]['printf_format'], True)
 
     def testVariadic(self):
@@ -956,8 +956,8 @@
 
     def testAllowNull(self):
         meta = OC_MetaDataTest.make4Tuple_.__metadata__()
-        self.assertIsNotIn('null_accepted', meta['retval'])
-        self.assertIsNotIn( 'null_accepted', meta['arguments'][0])
+        self.assertNotIn('null_accepted', meta['retval'])
+        self.assertNotIn( 'null_accepted', meta['arguments'][0])
 
         meta = OC_MetaDataTest.make4Tuple_.__metadata__()
         self.assertEquals(meta['arguments'][2]['null_accepted'], False)

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata_function.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata_function.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata_function.py	Sun Jul 18 04:29:29 2010
@@ -256,7 +256,7 @@
 class TestExists (TestCase):
     def testFunctionsExists(self):
         for item in _FunctionTable:
-            self.assertIsIn(item[0], globals())
+            self.assertIn(item[0], globals())
 
 class TestArrayDefault (TestCase):
     # TODO: what is the default anyway?

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_methodaccess.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_methodaccess.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_methodaccess.py	Sun Jul 18 04:29:29 2010
@@ -35,26 +35,26 @@
 
         d = dir(o.pyobjc_instanceMethods)
         self.assertGreaterThan(len(d), 10)
-        self.assertIsIn("init", d)
+        self.assertIn("init", d)
 
         d = dir(NSObject.pyobjc_classMethods)
         self.assertGreaterThan(len(d), 10)
-        self.assertIsIn("alloc", d)
+        self.assertIn("alloc", d)
 
     def testDict(self):
         o = NSObject.new()
 
         d = o.pyobjc_instanceMethods.__dict__.keys()
         self.assertGreaterThan(len(d), 10)
-        self.assertIsIn("init", d)
+        self.assertIn("init", d)
 
         d = NSObject.pyobjc_classMethods.__dict__.keys()
         self.assertGreaterThan(len(d), 10)
-        self.assertIsIn("alloc", d)
+        self.assertIn("alloc", d)
 
         #d = o.pyobjc_classMethods.__dict__.keys()
         #self.assertGreaterThan(len(d), 10)
-        #self.assertIsIn("alloc", d)
+        #self.assertIn("alloc", d)
 
     def testAttributes(self):
         o = NSObject.new()

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_methods.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_methods.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_methods.py	Sun Jul 18 04:29:29 2010
@@ -196,7 +196,7 @@
         OC_TestClass1.clsReset()
         self.assertEquals(len(OC_TestClass1.idClsFunc()), 0)
         self.assertEquals(type(OC_TestClass1.idClsFunc()).__name__, 'NSHost')
-        self.assertIsIn(str(OC_TestClass1.idClsFunc()), ('{}', '{\n}'))
+        self.assertIn(str(OC_TestClass1.idClsFunc()), ('{}', '{\n}'))
         self.assertEquals(OC_TestClass1.idClsFunc(), None)
 
     # testCls* ends here
@@ -309,7 +309,7 @@
         obj.reset()
         self.assertEquals(len(obj.idFunc()), 0)
         self.assertEquals(type(obj.idFunc()).__name__, 'NSHost')
-        self.assertIsIn(str(obj.idFunc()), ('{}', '{\n}'))
+        self.assertIn(str(obj.idFunc()), ('{}', '{\n}'))
         self.assertEquals(obj.idFunc(), None)
 
     def testStruct1(self):

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_number_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_number_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_number_proxy.py	Sun Jul 18 04:29:29 2010
@@ -138,7 +138,7 @@
         #   printf("%llu\n", lv);
         # 
 
-        self.assertIsIn(
+        self.assertIn(
                 OC_TestNumber.numberAsUnsignedLongLong_(v),
                     (18446744073709551489, 18446744073709551488))
 

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_objc.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_objc.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_objc.py	Sun Jul 18 04:29:29 2010
@@ -54,9 +54,9 @@
         NSException = objc.lookUpClass('NSException')
         NSMutableArray = objc.lookUpClass('NSMutableArray')
 
-        self.assertIsIn(NSObject, objc.getClassList())
-        self.assertIsIn(NSException, objc.getClassList())
-        self.assertIsIn(NSMutableArray, objc.getClassList())
+        self.assertIn(NSObject, objc.getClassList())
+        self.assertIn(NSException, objc.getClassList())
+        self.assertIn(NSMutableArray, objc.getClassList())
 
 class TestMethodInvocation(TestCase):
     def setUp(self):
@@ -74,7 +74,7 @@
 
 class TestClassDict(TestCase):
     def testDict(self):
-        self.assertIsIn("attributesAtIndex_longestEffectiveRange_inRange_", NSAttributedString.__dict__)
+        self.assertIn("attributesAtIndex_longestEffectiveRange_inRange_", NSAttributedString.__dict__)
 
 class TestPickle(TestCase):
     # We don't support pickling at the moment, make sure we enforce that.

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_protected.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_protected.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_protected.py	Sun Jul 18 04:29:29 2010
@@ -5,8 +5,8 @@
     def testProtectedNotInDir(self):
 
         d = dir(PyObjCTest_Protected)
-        self.assertIsIn('publicMethod', d)
-        self.assertIsNotIn('_protectedMethod', d)
+        self.assertIn('publicMethod', d)
+        self.assertNotIn('_protectedMethod', d)
 
     def testProtectedCallable(self):
         o = PyObjCTest_Protected.new()

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_set_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_set_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_set_proxy.py	Sun Jul 18 04:29:29 2010
@@ -88,7 +88,7 @@
         self.assertEquals(OC_TestSet.anyObjectOfSet_(s), None)
 
         s = self.setClass([1,2,3,4])
-        self.assertIsIn(OC_TestSet.anyObjectOfSet_(s), s)
+        self.assertIn(OC_TestSet.anyObjectOfSet_(s), s)
 
     def testContainsObject_(self):
         s = self.setClass([1,2,3])

Modified: trunk/pyobjc/pyobjc-core/PyObjCTest/test_subclass.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/PyObjCTest/test_subclass.py	(original)
+++ trunk/pyobjc/pyobjc-core/PyObjCTest/test_subclass.py	Sun Jul 18 04:29:29 2010
@@ -289,8 +289,8 @@
         self.assertEquals(aList, [])
         del o
         self.assertEquals(len(aList), 2)
-        self.assertIsIn('dealloc', aList)
-        self.assertIsIn('__del__', aList)
+        self.assertIn('dealloc', aList)
+        self.assertIn('__del__', aList)
 
         class SubClassWithDealloc(ClassWithDealloc):
             def dealloc(self):
@@ -302,9 +302,9 @@
         self.assertEquals(aList, [])
         del o
         self.assertEquals(len(aList), 3)
-        self.assertIsIn('dealloc.dealloc', aList)
-        self.assertIsIn('dealloc', aList)
-        self.assertIsIn('__del__', aList)
+        self.assertIn('dealloc.dealloc', aList)
+        self.assertIn('dealloc', aList)
+        self.assertIn('__del__', aList)
 
         class ClassWithDeallocAndDel(NSObject):
             def init(self):
@@ -325,9 +325,9 @@
         self.assertEquals(aList, [])
         del o
         self.assertEquals(len(aList), 3)
-        self.assertIsIn('mydel', aList)
-        self.assertIsIn('dealloc', aList)
-        self.assertIsIn('__del__', aList)
+        self.assertIn('mydel', aList)
+        self.assertIn('dealloc', aList)
+        self.assertIn('__del__', aList)
 
     def testMethodNames(self):
 

Modified: trunk/pyobjc/pyobjc-core/setup.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/setup.py	(original)
+++ trunk/pyobjc/pyobjc-core/setup.py	Sun Jul 18 04:29:29 2010
@@ -69,8 +69,23 @@
             if rootdir in sys.path:
                 sys.path.remove(rootdir)
 
+        ei_cmd = self.get_finalized_command('egg_info')
+        egg_name = ei_cmd.egg_name.replace('-', '_')
+
+        to_remove = []
+        for dirname in sys.path:
+            bn = os.path.basename(dirname)
+            if bn.startswith(egg_name + "-"):
+                to_remove.append(dirname)
+
+        for dirname in to_remove:
+            log.info("removing installed %r from sys.path before testing"%(dirname,))
+            sys.path.remove(dirname)
+
         from PyObjCTest.loader import makeTestSuite
         import unittest
+
+        #import pprint; pprint.pprint(sys.path)
        
         unittest.main(None, None, [unittest.__file__]+self.test_args)
 
@@ -287,6 +302,7 @@
 ## on i386 systems when a method returns a struct that isn't returned
 ## in registers. 
 if '-O0' in get_config_var('CFLAGS'):
+    print "Change -O0 to -O1"
     CFLAGS.append('-O1')
 
 OBJC_LDFLAGS = frameworks('CoreFoundation', 'Foundation', 'Carbon')

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first