[Checkins] SVN: transaction/branches/sphinx/ Fix spewage.

Tres Seaver cvs-admin at zope.org
Tue Dec 18 02:59:09 UTC 2012


Log message for revision 128743:
  Fix spewage.

Changed:
  _U  transaction/branches/sphinx/
  U   transaction/branches/sphinx/transaction/tests/test__transaction.py

-=-
Modified: transaction/branches/sphinx/transaction/tests/test__transaction.py
===================================================================
--- transaction/branches/sphinx/transaction/tests/test__transaction.py	2012-12-18 02:41:51 UTC (rev 128742)
+++ transaction/branches/sphinx/transaction/tests/test__transaction.py	2012-12-18 02:59:09 UTC (rev 128743)
@@ -604,15 +604,24 @@
                             "Error in after commit hook"))
 
     def test_callAfterCommitHook_w_abort(self):
-        _hooked2 = [], []
+        from transaction.tests.common import DummyLogger
+        from transaction.tests.common import Monkey
+        from transaction import _transaction
+        _hooked2 = []
         def _hook1(*args, **kw):
             raise ValueError()
         def _hook2(*args, **kw):
             _hooked2.append((args, kw))
-        tm = self._makeOne()
+        logger = DummyLogger()
+        with Monkey(_transaction, _LOGGER=logger):
+            tm = self._makeOne()
+        logger._clear()
         tm.addAfterCommitHook(_hook1, ('one',))
         tm.addAfterCommitHook(_hook2, ('two',), dict(dos=2))
         tm._callAfterCommitHooks()
+        self.assertEqual(logger._log[0][0], 'error')
+        self.assertTrue(logger._log[0][1].startswith(
+                            "Error in after commit hook"))
 
     def test_note(self):
         t = self._makeOne()



More information about the checkins mailing list