[Zodb-checkins] SVN: ZODB/branches/3.10/src/ merged ZODB/branches/tseaver-squelch_2.6_warnings to avoid a warning
Jim Fulton
jim at zope.com
Fri Feb 11 13:04:56 EST 2011
Log message for revision 120284:
merged ZODB/branches/tseaver-squelch_2.6_warnings to avoid a warning
while running tests.
Changed:
U ZODB/branches/3.10/src/BTrees/tests/test_compare.py
U ZODB/branches/3.10/src/ZEO/tests/zeoserver.py
-=-
Modified: ZODB/branches/3.10/src/BTrees/tests/test_compare.py
===================================================================
--- ZODB/branches/3.10/src/BTrees/tests/test_compare.py 2011-02-11 17:57:57 UTC (rev 120283)
+++ ZODB/branches/3.10/src/BTrees/tests/test_compare.py 2011-02-11 18:04:56 UTC (rev 120284)
@@ -47,8 +47,19 @@
self.assertRaises(UnicodeError, callable, *args)
def testBucketGet(self):
- self.bucket[self.s] = 1
- self.assertUE(self.bucket.get, self.u)
+ import sys
+ 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):
self.set.insert(self.s)
Modified: ZODB/branches/3.10/src/ZEO/tests/zeoserver.py
===================================================================
--- ZODB/branches/3.10/src/ZEO/tests/zeoserver.py 2011-02-11 17:57:57 UTC (rev 120283)
+++ ZODB/branches/3.10/src/ZEO/tests/zeoserver.py 2011-02-11 18:04:56 UTC (rev 120284)
@@ -210,4 +210,6 @@
if __name__ == '__main__':
+ import warnings
+ warnings.simplefilter('ignore')
main()
More information about the Zodb-checkins
mailing list