Skip to content

Commit

Permalink
Update to persistent >= 4.2.3. (#9)
Browse files Browse the repository at this point in the history
* Update to persistent >= 4.2.3.

* Use the version of `PickleCache` matching the used `persistent` variant.
  • Loading branch information
Michael Howitz committed Feb 2, 2018
1 parent d1d06f5 commit d692e20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
3.0b3 (unreleased)
------------------

- Make tests compatible with `persistent >= 4.2.3`.

3.0b2 (2017-11-27)
------------------
Expand Down
29 changes: 9 additions & 20 deletions src/Persistence/tests/test_persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from Persistence import IS_PYPY, IS_PURE
from Persistence import Persistent
from persistent.picklecache import PickleCache
from persistent import PickleCache
from persistent.TimeStamp import TimeStamp


Expand Down Expand Up @@ -108,29 +108,18 @@ def test_oid_jar_attrs(self):

self.jar.add(obj)

if not (IS_PURE or IS_PYPY):
# Can change oid of cache object since persistent 4.0.8
# Can't change oid of cache object.
with self.assertRaises(ValueError):
del obj._p_oid

with self.assertRaises(ValueError):
obj._p_oid = 12

with self.assertRaises(ValueError):
del obj._p_jar

with self.assertRaises(ValueError):
obj._p_jar = 12
else:
# Can't change oid of cache object.
def deloid():
del obj._p_oid
self.assertRaises(ValueError, deloid)

def setoid():
obj._p_oid = 12
self.assertRaises(ValueError, setoid)

def deloid():
del obj._p_jar
self.assertRaises(ValueError, deloid)

def setoid():
obj._p_jar = 12
self.assertRaises(ValueError, setoid)

def testChanged(self):
obj = P()
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ envlist =
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir}
{envbindir}/test {posargs:-v1}
{envbindir}/test {posargs:-vc1}
skip_install = true
deps =
setuptools==33.1.1
Expand Down

0 comments on commit d692e20

Please sign in to comment.