[CMF-checkins]
SVN: CMF/branches/1.5/CMFCore/tests/test_WorkflowTool.py
Don't muck with warnings.filters.
Tres Seaver
tseaver at palladion.com
Wed Oct 19 09:32:29 EDT 2005
Log message for revision 39511:
Don't muck with warnings.filters.
Changed:
U CMF/branches/1.5/CMFCore/tests/test_WorkflowTool.py
-=-
Modified: CMF/branches/1.5/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/branches/1.5/CMFCore/tests/test_WorkflowTool.py 2005-10-19 12:21:35 UTC (rev 39510)
+++ CMF/branches/1.5/CMFCore/tests/test_WorkflowTool.py 2005-10-19 13:32:29 UTC (rev 39511)
@@ -25,7 +25,9 @@
from OFS.SimpleItem import SimpleItem
+from Products.CMFCore.tests.base.testcase import WarningInterceptor
+
class Dummy( SimpleItem ):
def __init__( self, id ):
@@ -134,7 +136,7 @@
return None
-class WorkflowToolTests(TestCase):
+class WorkflowToolTests(TestCase, WarningInterceptor):
def setUp( self ):
from Products.CMFCore.WorkflowTool import addWorkflowFactory
@@ -143,6 +145,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
@@ -303,11 +306,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