Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
Kirill Smelkov
persistent
Commits
4cda388a
Commit
4cda388a
authored
Mar 31, 2015
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from zopefoundation/fix-pypy3
fix test___setstate___interns_dict_keys failure on pypy3
parents
9d1f8e77
1794782a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
.travis.yml
.travis.yml
+2
-0
persistent/tests/test_persistence.py
persistent/tests/test_persistence.py
+20
-13
No files found.
.travis.yml
View file @
4cda388a
...
...
@@ -5,7 +5,9 @@ python:
-
2.7
-
3.2
-
3.3
-
3.4
-
pypy
-
pypy3
install
:
-
pip install . --use-mirrors
script
:
...
...
persistent/tests/test_persistence.py
View file @
4cda388a
...
...
@@ -14,6 +14,12 @@
import
os
import
unittest
import
platform
import
sys
py_impl
=
getattr
(
platform
,
'python_implementation'
,
lambda
:
None
)
_is_pypy3
=
py_impl
()
==
'PyPy'
and
sys
.
version_info
[
0
]
>
2
class
_Persistent_Base
(
object
):
def
_makeOne
(
self
,
*
args
,
**
kw
):
...
...
@@ -863,19 +869,20 @@ class _Persistent_Base(object):
self
.
assertEqual
(
inst
.
baz
,
'bam'
)
self
.
assertEqual
(
inst
.
qux
,
'spam'
)
def
test___setstate___interns_dict_keys
(
self
):
class
Derived
(
self
.
_getTargetClass
()):
pass
inst1
=
Derived
()
inst2
=
Derived
()
key1
=
'key'
key2
=
'ke'
;
key2
+=
'y'
# construct in a way that won't intern the literal
self
.
assertFalse
(
key1
is
key2
)
inst1
.
__setstate__
({
key1
:
1
})
inst2
.
__setstate__
({
key2
:
2
})
key1
=
list
(
inst1
.
__dict__
.
keys
())[
0
]
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
self
.
assertTrue
(
key1
is
key2
)
if
not
_is_pypy3
:
def
test___setstate___interns_dict_keys
(
self
):
class
Derived
(
self
.
_getTargetClass
()):
pass
inst1
=
Derived
()
inst2
=
Derived
()
key1
=
'key'
key2
=
'ke'
;
key2
+=
'y'
# construct in a way that won't intern the literal
self
.
assertFalse
(
key1
is
key2
)
inst1
.
__setstate__
({
key1
:
1
})
inst2
.
__setstate__
({
key2
:
2
})
key1
=
list
(
inst1
.
__dict__
.
keys
())[
0
]
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
self
.
assertTrue
(
key1
is
key2
)
def
test___reduce__
(
self
):
from
persistent._compat
import
copy_reg
...
...
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