summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2015-06-02 12:42:07 -0500
committerJason Madden <jamadden@gmail.com>2015-06-02 12:42:07 -0500
commit10a9a4634f9398b4554f18b34fc2004558acf075 (patch)
tree5673a5083ed477f767bc1ccc23696fd21a987e56
parent2da9f225088b0aad321fc455f218453fe83483b0 (diff)
downloadzope-security-10a9a4634f9398b4554f18b34fc2004558acf075.tar.gz
Skip the failing class-hashing tests under PyPy 2.5.0. Fixes #11.
-rw-r--r--src/zope/security/tests/test_proxy.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zope/security/tests/test_proxy.py b/src/zope/security/tests/test_proxy.py
index aaed8e6..ca4a8a3 100644
--- a/src/zope/security/tests/test_proxy.py
+++ b/src/zope/security/tests/test_proxy.py
@@ -36,6 +36,14 @@ def _skip_if_Py2(testfunc):
return dummy
return testfunc
+def _skip_if_pypy250(testfunc):
+ from functools import update_wrapper
+ if PYPY and sys.pypy_version_info[:3] == (2,5,0):
+ def dummy(self):
+ pass
+ update_wrapper(dummy, testfunc)
+ return dummy
+ return testfunc
class ProxyTestBase(object):
@@ -1704,6 +1712,13 @@ class ProxyTests(unittest.TestCase):
from zope.security.proxy import getChecker
self.assertEqual(self.c, getChecker(self.p))
+
+ # XXX: PyPy 2.5.0 has a bug where proxys around types
+ # aren't correctly hashable, which breaks this part of the
+ # test. This is fixed in 2.5.1+, but as of 2015-05-28,
+ # TravisCI still uses 2.5.0.
+
+ @_skip_if_pypy250
def testProxiedClassicClassAsDictKey(self):
from zope.security.proxy import ProxyFactory
class C(object):
@@ -1712,6 +1727,7 @@ class ProxyTests(unittest.TestCase):
pC = ProxyFactory(C, self.c)
self.assertEqual(d[pC], d[C])
+ @_skip_if_pypy250
def testProxiedNewClassAsDictKey(self):
from zope.security.proxy import ProxyFactory
class C(object):