diff options
author | Tres Seaver <tseaver@palladion.com> | 2015-06-02 13:59:33 -0400 |
---|---|---|
committer | Tres Seaver <tseaver@palladion.com> | 2015-06-02 13:59:33 -0400 |
commit | ee409d022cba7fed2ed8e2c35f92dfe56901a625 (patch) | |
tree | 384797b31ea33af2f859dd7f803a002b9a4f1851 | |
parent | 74d7b3ad03bb74a9df50dc467810d619271b731d (diff) | |
parent | 10a9a4634f9398b4554f18b34fc2004558acf075 (diff) | |
download | zope-security-ee409d022cba7fed2ed8e2c35f92dfe56901a625.tar.gz |
Merge pull request #12 from NextThought/pypy-support
Skip the failing class-hashing tests under PyPy 2.5.0. Fixes #11.
-rw-r--r-- | src/zope/security/tests/test_proxy.py | 16 |
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): |