[pypy-svn] r61540 - pypy/trunk/lib-python/modified-2.5.2/test

antocuni at codespeak.net antocuni at codespeak.net
Wed Feb 4 11:00:53 CET 2009


Author: antocuni
Date: Wed Feb  4 11:00:50 2009
New Revision: 61540

Added:
   pypy/trunk/lib-python/modified-2.5.2/test/test_functools.py
      - copied, changed from r61532, pypy/trunk/lib-python/2.5.2/test/test_functools.py
Log:
make test_functools passing; for one test, we raise AttributeError instead of
TypeError when trying to delete an attribute, but I think it can be considered
impl detail.

For the other, we just need to add the usual gc.collect()



Copied: pypy/trunk/lib-python/modified-2.5.2/test/test_functools.py (from r61532, pypy/trunk/lib-python/2.5.2/test/test_functools.py)
==============================================================================
--- pypy/trunk/lib-python/2.5.2/test/test_functools.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_functools.py	Wed Feb  4 11:00:50 2009
@@ -121,7 +121,7 @@
         p = self.thetype(hex)
         try:
             del p.__dict__
-        except TypeError:
+        except (TypeError, AttributeError):
             pass
         else:
             self.fail('partial object allowed __dict__ to be deleted')
@@ -131,6 +131,8 @@
         p = proxy(f)
         self.assertEqual(f.func, p.func)
         f = None
+        import gc
+        gc.collect()
         self.assertRaises(ReferenceError, getattr, p, 'func')
 
     def test_with_bound_and_unbound_methods(self):



More information about the Pypy-commit mailing list