[CMF-checkins] SVN: CMF/trunk/CMFCore/tests/test_WorkflowTool.py
Don't muck with warnings.filters.
Tres Seaver
tseaver at palladion.com
Wed Oct 19 09:51:51 EDT 2005
Log message for revision 39513:
Don't muck with warnings.filters.
Changed:
U CMF/trunk/CMFCore/tests/test_WorkflowTool.py
-=-
Modified: CMF/trunk/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_WorkflowTool.py 2005-10-19 13:43:55 UTC (rev 39512)
+++ CMF/trunk/CMFCore/tests/test_WorkflowTool.py 2005-10-19 13:51:51 UTC (rev 39513)
@@ -22,7 +22,9 @@
from OFS.SimpleItem import SimpleItem
+from Products.CMFCore.tests.base.testcase import WarningInterceptor
+
class Dummy( SimpleItem ):
def __init__( self, id ):
@@ -131,7 +133,7 @@
return None
-class WorkflowToolTests(TestCase):
+class WorkflowToolTests(TestCase, WarningInterceptor):
def setUp( self ):
from Products.CMFCore.WorkflowTool import addWorkflowFactory
@@ -140,6 +142,7 @@
def tearDown( self ):
from Products.CMFCore.WorkflowTool import _removeWorkflowFactory
_removeWorkflowFactory( DummyWorkflow )
+ self._free_warning_output()
def _makeOne( self, workflow_ids=() ):
from Products.CMFCore.WorkflowTool import WorkflowTool
@@ -296,11 +299,8 @@
tool = self._makeWithTypesAndChain()
dummy = DummyContent( 'dummy' )
- warnings.filterwarnings("ignore", category=DeprecationWarning)
- try:
- actions = tool.getActionsFor( dummy )
- finally:
- warnings.resetwarnings()
+ self._trap_warning_output()
+ actions = tool.getActionsFor( dummy )
self.assertEqual( len( actions ), 0 )
def test_getInfoFor( self ):
More information about the CMF-checkins
mailing list