[pypy-commit] pypy identity-dict-strategy: add a test for old classes, which are not supported

antocuni noreply at buildbot.pypy.org
Thu Jul 21 13:48:51 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: identity-dict-strategy
Changeset: r45806:d8d5656b9fb0
Date: 2011-07-21 13:40 +0200
http://bitbucket.org/pypy/pypy/changeset/d8d5656b9fb0/

Log:	add a test for old classes, which are not supported

diff --git a/pypy/objspace/std/test/test_identitydict.py b/pypy/objspace/std/test/test_identitydict.py
--- a/pypy/objspace/std/test/test_identitydict.py
+++ b/pypy/objspace/std/test/test_identitydict.py
@@ -45,7 +45,6 @@
         assert self.compares_by_identity(X)
 
 
-
 class AppTestIdentityDict(object):
     def setup_class(cls):
         cls.space = gettestobjspace(**{"objspace.std.withidentitydict": True})
@@ -128,3 +127,10 @@
         assert d1 == d2
         assert self.uses_identity_strategy(d1)
         assert not self.uses_identity_strategy(d2)
+
+    def test_old_style_classes(self):
+        class X:
+            pass
+            
+        d = {X(): 1}
+        assert not self.uses_identity_strategy(d)


More information about the pypy-commit mailing list