Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zope.proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
zope.proxy
Commits
f9e5240c
Commit
f9e5240c
authored
May 28, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround bizarre bug in PyPy 2.5.0 where proxys around types cannot be correctly hashed.
parent
0018bc9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
src/zope/proxy/tests/test_proxy.py
src/zope/proxy/tests/test_proxy.py
+19
-5
No files found.
src/zope/proxy/tests/test_proxy.py
View file @
f9e5240c
...
...
@@ -719,20 +719,34 @@ class PyProxyBaseTestCase(unittest.TestCase):
class
IFoo
(
Interface
):
pass
impl_before
=
list
(
implementedBy
(
builtin_type
))
classImplements
(
builtin_type
,
IFoo
)
builtin
=
builtin_type
()
self
.
assertTrue
(
IFoo
in
list
(
providedBy
(
builtin
)))
self
.
assertTrue
(
IFoo
in
list
(
implementedBy
(
builtin_type
)))
try
:
proxy_instance
=
proxy_class
(
builtin
)
provided_instance
=
providedBy
(
proxy_instance
)
proxy_type
=
proxy_class
(
builtin_type
)
provided_type
=
implementedBy
(
proxy_type
)
# The asserts must be before we remove the interface
# because there's a single object that gets mutated
proxy_instance
=
proxy_class
(
builtin
)
provided_instance
=
providedBy
(
proxy_instance
)
self
.
assertTrue
(
IFoo
in
list
(
provided_instance
))
self
.
assertTrue
(
IFoo
in
list
(
provided_type
))
# 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.
proxy_type
=
proxy_class
(
builtin_type
)
from
zope.interface.declarations
import
BuiltinImplementationSpecifications
if
proxy_type
in
BuiltinImplementationSpecifications
\
and
BuiltinImplementationSpecifications
.
get
(
proxy_type
,
self
)
is
not
self
:
provided_type
=
implementedBy
(
proxy_type
)
self
.
assertTrue
(
IFoo
in
list
(
provided_type
))
else
:
import
sys
self
.
assertEqual
((
2
,
5
,
0
),
sys
.
pypy_version_info
[:
3
])
finally
:
classImplementsOnly
(
builtin_type
,
*
impl_before
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment