[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/tests/testZEO.py Made a test more flexible to unrelated logging changes.

Jim Fulton jim at zope.com
Fri Dec 18 15:07:51 EST 2009


Log message for revision 106770:
  Made a test more flexible to unrelated logging changes.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/testZEO.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py	2009-12-18 19:57:01 UTC (rev 106769)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py	2009-12-18 20:07:51 UTC (rev 106770)
@@ -486,14 +486,18 @@
         # logged
         self._storage._connection.handle_request('foo',0,'history',(1,2,3,4))
         # test logging
-        level,message,kw = log[1]
-        self.assertEqual(level,logging.ERROR)
-        self.failUnless(message.endswith(
+
+        for level, message, kw in log:
+            if message.endswith(
                 ') history() raised exception: history() takes at'
                 ' most 3 arguments (5 given)'
-                ))
-        self.assertEqual(kw,{'exc_info':True})
-        
+                ):
+                self.assertEqual(level,logging.ERROR)
+                self.assertEqual(kw,{'exc_info':True})
+                break
+        else:
+            self.fail("error not in log")
+
         # cleanup
         del conn.logger.log
 



More information about the Zodb-checkins mailing list