[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/ getting rid of the zLOG module including some zLOG culprits

Andreas Jung andreas at andreas-jung.com
Sun Jan 8 09:28:45 EST 2006


Log message for revision 41217:
  getting rid of the zLOG module including some zLOG culprits
  in some unittests (if necessary we need to restablish the hacks
  in a saner way)
  

Changed:
  U   Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py
  U   Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/tests/testTextIndex.py

-=-
Modified: Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py	2006-01-08 14:18:26 UTC (rev 41216)
+++ Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py	2006-01-08 14:28:44 UTC (rev 41217)
@@ -20,8 +20,6 @@
 import Zope2
 Zope2.startup()
 
-import zLOG
-
 from Products.PluginIndexes.KeywordIndex.KeywordIndex import KeywordIndex
 
 
@@ -78,27 +76,6 @@
         """
         """
 
-    def _catch_log_errors( self ):
-
-        if self._old_log_write is not None:
-            return
-
-        def log_write(subsystem, severity, summary, detail, error,
-                    PROBLEM=zLOG.PROBLEM):
-            if severity > PROBLEM:
-                assert 0, "%s(%s): %s" % (subsystem, severity, summary)
-
-        self._old_log_write = zLOG.log_write
-        zLOG.log_write = log_write
-
-    def _ignore_log_errors( self ):
-
-        if self._old_log_write is None:
-            return
-
-        zLOG.log_write = self._old_log_write
-        del self._old_log_write
-
     def _populateIndex( self ):
         for k, v in self._values:
             self._index.index_object( k, v )
@@ -126,12 +103,11 @@
 
     def testAddObjectWOKeywords(self):
 
-        self._catch_log_errors()
         try:
             self._populateIndex()
             self._index.index_object(999, None)
         finally:
-            self._ignore_log_errors()
+            pass
 
     def testEmpty( self ):
         assert len( self._index ) == 0
@@ -236,12 +212,11 @@
         self._checkApply( record, self._values[6:7] )
 
     def testDuplicateKeywords(self):
-        self._catch_log_errors()
         try:
             self._index.index_object(0, Dummy(['a', 'a', 'b', 'b']))
             self._index.unindex_object(0)
         finally:
-            self._ignore_log_errors()
+            pass
 
     def testCollectorIssue889(self) :
         # Test that collector issue 889 is solved

Modified: Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/tests/testTextIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/tests/testTextIndex.py	2006-01-08 14:18:26 UTC (rev 41216)
+++ Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/tests/testTextIndex.py	2006-01-08 14:28:44 UTC (rev 41217)
@@ -20,12 +20,6 @@
 import Zope2
 Zope2.startup()
 
-import zLOG
-
-def log_write(subsystem, severity, summary, detail, error):
-    if severity >= zLOG.PROBLEM:
-        assert 0, "%s(%s): %s" % (subsystem, severity, summary)
-
 import ZODB
 from ZODB.MappingStorage import MappingStorage
 import transaction
@@ -56,8 +50,6 @@
     def setUp(self):
         self.index=TextIndex.TextIndex('text')
         self.doc=Dummy(text='this is the time, when all good zopes')
-        self.old_log_write = zLOG.log_write
-        zLOG.log_write=log_write
 
     def dbopen(self):
         if self.db is None:
@@ -84,7 +76,6 @@
         if self.db is not None:
             self.db.close()
             self.db = None
-        zLOG.log_write=self.old_log_write
 
     def test_z3interfaces(self):
         from Products.PluginIndexes.interfaces import IPluggableIndex



More information about the Zope-Checkins mailing list