diff --git a/CHANGES.rst b/CHANGES.rst index 7add7c5..9135f74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changelog 3.0b3 (unreleased) ------------------ +- Make tests compatible with `persistent >= 4.2.3`. 3.0b2 (2017-11-27) ------------------ diff --git a/src/Persistence/tests/test_persistent.py b/src/Persistence/tests/test_persistent.py index 1d1f25f..bb99ee2 100644 --- a/src/Persistence/tests/test_persistent.py +++ b/src/Persistence/tests/test_persistent.py @@ -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 @@ -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() diff --git a/tox.ini b/tox.ini index 84a702a..a89855b 100644 --- a/tox.ini +++ b/tox.ini @@ -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