Skip to content

Commit

Permalink
Merge branch 'python34' of git://github.com/NextThought/zodbpickle in…
Browse files Browse the repository at this point in the history
…to NextThought-python34

Conflicts:
	.travis.yml
	src/zodbpickle/tests/pickletester_2.py
  • Loading branch information
tseaver committed Apr 2, 2015
2 parents c9880c0 + f82a724 commit 4dd0697
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ python:
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
- pypy3
install:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -61,6 +61,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Framework :: ZODB',
Expand Down
15 changes: 12 additions & 3 deletions src/zodbpickle/tests/pickletester_3.py
Expand Up @@ -30,6 +30,8 @@ def wrapper(*args, **kwargs):
return wrapper

_PY33 = sys.version_info[:2] >= (3, 3)
_PY34 = sys.version_info[:2] >= (3, 4)
_PY343 = sys.version_info[:3] >= (3, 4, 3)

from zodbpickle.pickle_3 import bytes_types
from . import _is_pure
Expand Down Expand Up @@ -1109,8 +1111,8 @@ def test_bad_getattr(self):
for proto in 0, 1:
self.assertRaises(RuntimeError, self.dumps, x, proto)

# protocol 2 don't raise a RuntimeError, except under PyPy
if _is_pypy or _is_pure:
# protocol 2 don't raise a RuntimeError, except under PyPy, or Python >= 3.4
if _is_pypy or (_is_pure and not _PY33) or _PY34:
self.assertRaises(RuntimeError, self.dumps, x, 2)
else:
self.dumps(x, 2)
Expand Down Expand Up @@ -1180,7 +1182,14 @@ def test_unpickle_from_2x(self):
loaded = self.loads(DATA5)
self.assertEqual(type(loaded), SimpleCookie)
self.assertEqual(list(loaded.keys()), ["key"])
self.assertEqual(loaded["key"].value, "Set-Cookie: key=value")
if _PY343:
# The SimpleCookie object changed the way it gets
# constructed in Python 3.4.3; the old behaviour was
# broken.
# See http://bugs.python.org/issue22775
self.assertEqual(loaded["key"].value, "value")
else:
self.assertEqual(loaded["key"].value, "Set-Cookie: key=value")

def test_pickle_to_2x(self):
# Pickle non-trivial data with protocol 2, expecting that it yields
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py26,py27,py32,py33,pypy,pypy3
envlist = py26,py27,py32,py33,py34,pypy,pypy3

[testenv]
deps =
Expand Down

0 comments on commit 4dd0697

Please sign in to comment.