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

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <20091218200751.AE3D17083BC__2870.89372654936$1261166886$gmane$org@cvs.zope.org>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.