[pypy-commit] pypy identity-dict-strategy: reset the version numbers after each test

antocuni noreply at buildbot.pypy.org
Tue Jul 19 18:44:24 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: identity-dict-strategy
Changeset: r45745:78d8ec2a9f71
Date: 2011-07-19 18:32 +0200
http://bitbucket.org/pypy/pypy/changeset/78d8ec2a9f71/

Log:	reset the version numbers after each test

diff --git a/pypy/objspace/std/test/test_typeobject.py b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1211,12 +1211,15 @@
             return space.wrap(w_cls.compares_by_identity())
         cls.w_compares_by_identity = cls.space.wrap(interp2app(compares_by_identity))
 
-        versions = {}
         def get_version(space):
-            v = versions.setdefault(space.compares_by_identity_version, len(versions))
+            v = cls.versions.setdefault(space.compares_by_identity_version,
+                                        len(cls.versions))
             return space.wrap(v)
         cls.w_get_version = cls.space.wrap(interp2app(get_version))
 
+    def setup_method(self, m):
+        self.__class__.versions = {}
+
     def test_compares_by_identity(self):
         class Plain(object):
             pass


More information about the pypy-commit mailing list