[pypy-commit] pypy cffi-1.0: Fix tests

arigo noreply at buildbot.pypy.org
Sat May 2 22:35:55 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r76988:fd8087e42b2d
Date: 2015-05-02 22:01 +0200
http://bitbucket.org/pypy/pypy/changeset/fd8087e42b2d/

Log:	Fix tests

diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py
--- a/pypy/module/_cffi_backend/newtype.py
+++ b/pypy/module/_cffi_backend/newtype.py
@@ -42,6 +42,9 @@
         x = intmask((1000003 * x) ^ y)
     return x
 
+def _clean_cache(space):
+    space.fromcache(UniqueCache).__init__(space)
+
 # ____________________________________________________________
 
 
diff --git a/pypy/module/_cffi_backend/test/test_ffi_obj.py b/pypy/module/_cffi_backend/test/test_ffi_obj.py
--- a/pypy/module/_cffi_backend/test/test_ffi_obj.py
+++ b/pypy/module/_cffi_backend/test/test_ffi_obj.py
@@ -1,7 +1,11 @@
+from pypy.module._cffi_backend.newtype import _clean_cache
 
 class AppTestFFIObj:
     spaceconfig = dict(usemodules=('_cffi_backend', ))
 
+    def teardown_method(self, meth):
+        _clean_cache(self.space)
+
     def test_ffi_new(self):
         import _cffi_backend as _cffi1_backend
         ffi = _cffi1_backend.FFI()


More information about the pypy-commit mailing list