Commit 5bd316ae authored by Jeremy Hylton's avatar Jeremy Hylton

Convert testSets DeprecationWarnings into exceptions.

parent 61a38522
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
import os import os
import time import time
import unittest import unittest
import warnings
import ZODB import ZODB
import ZODB.FileStorage import ZODB.FileStorage
...@@ -48,9 +49,15 @@ class DBTests(unittest.TestCase): ...@@ -48,9 +49,15 @@ class DBTests(unittest.TestCase):
def testSets(self): def testSets(self):
# test set methods that have non-trivial implementations # test set methods that have non-trivial implementations
self.db.setCacheDeactivateAfter(12) # deprecated warnings.filterwarnings("error", category=DeprecationWarning)
self.assertRaises(DeprecationWarning,
self.db.setCacheDeactivateAfter, 12)
self.assertRaises(DeprecationWarning,
self.db.setVersionCacheDeactivateAfter, 12)
# XXX There is no API call for removing the warning we just
# added, but filters appears to be a public variable.
del warnings.filters[0]
self.db.setCacheSize(15) self.db.setCacheSize(15)
self.db.setVersionCacheDeactivateAfter(12) # deprecated
self.db.setVersionCacheSize(15) self.db.setVersionCacheSize(15)
def test_removeVersionPool(self): def test_removeVersionPool(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment