Commit d96fda3a authored by Jim Fulton's avatar Jim Fulton

merged ZODB/branches/tseaver-squelch_2.6_warnings to avoid a warning

while running tests.
parent 8186e691
...@@ -47,8 +47,19 @@ class CompareTest(unittest.TestCase): ...@@ -47,8 +47,19 @@ class CompareTest(unittest.TestCase):
self.assertRaises(UnicodeError, callable, *args) self.assertRaises(UnicodeError, callable, *args)
def testBucketGet(self): def testBucketGet(self):
self.bucket[self.s] = 1 import sys
self.assertUE(self.bucket.get, self.u) import warnings
_warnlog = []
def _showwarning(*args, **kw):
_warnlog.append((args, kw))
warnings.showwarning, _before = _showwarning, warnings.showwarning
try:
self.bucket[self.s] = 1
self.assertUE(self.bucket.get, self.u)
finally:
warnings.showwarning = _before
if sys.version_info >= (2, 6):
self.assertEqual(len(_warnlog), 1)
def testSetGet(self): def testSetGet(self):
self.set.insert(self.s) self.set.insert(self.s)
......
...@@ -210,4 +210,6 @@ def main(): ...@@ -210,4 +210,6 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
import warnings
warnings.simplefilter('ignore')
main() main()
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