Skip to content

Commit

Permalink
Merge pull request #12 from NextThought/pypy-support
Browse files Browse the repository at this point in the history
Skip the failing class-hashing tests under PyPy 2.5.0. Fixes #11.
  • Loading branch information
tseaver committed Jun 2, 2015
2 parents 74d7b3a + 10a9a46 commit ee409d0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/zope/security/tests/test_proxy.py
Expand Up @@ -36,6 +36,14 @@ def dummy(self):
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):

Expand Down Expand Up @@ -1704,6 +1712,13 @@ def testGetChecker(self):
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):
Expand All @@ -1712,6 +1727,7 @@ class C(object):
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):
Expand Down

0 comments on commit ee409d0

Please sign in to comment.