[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/container/browser/tests/test_adding.py Move setUp/tearDown calls out of the individual doctests.

Marius Gedminas marius at pov.lt
Sat Jan 20 07:28:25 EST 2007


Log message for revision 72125:
  Move setUp/tearDown calls out of the individual doctests.
  
  

Changed:
  U   Zope3/trunk/src/zope/app/container/browser/tests/test_adding.py

-=-
Modified: Zope3/trunk/src/zope/app/container/browser/tests/test_adding.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/tests/test_adding.py	2007-01-20 12:27:12 UTC (rev 72124)
+++ Zope3/trunk/src/zope/app/container/browser/tests/test_adding.py	2007-01-20 12:28:24 UTC (rev 72125)
@@ -213,7 +213,6 @@
 
 def test_constraint_driven_addingInfo():
     """
-    >>> setUp()
     >>> registerAddMenu()
 
     >>> class TestMenu(zope.interface.Interface):
@@ -276,12 +275,10 @@
     'item2'
     >>> items[2]['title']
     'item3'
-    >>> tearDown()
     """
 
 def test_constraint_driven_add():
     """
-    >>> setUp()
     >>> from zope.app.container.sample import SampleContainer
     >>> from zope.app.container.browser.adding import Adding
 
@@ -340,7 +337,6 @@
     >>> adding = Adding(ValidContainer(), TestRequest())
     >>> c = adding.add(F1())
 
-    >>> tearDown()
     """
 
 
@@ -348,7 +344,6 @@
     """
     Test for nameAllowed in adding.py
 
-    >>> setUp()
     >>> from zope.app.container.browser.adding import Adding
     >>> from zope.app.container.interfaces import IContainerNamesContainer
 
@@ -376,7 +371,6 @@
     >>> adding.nameAllowed()
     True
 
-    >>> tearDown()
     """
 
 
@@ -429,7 +423,6 @@
     This tests the condition if the content has Custom Add views and
     the container contains only a single content object
 
-    >>> setUp()
     >>> registerAddMenu()
     >>> defineMenuItem(AddMenu, IAdding, '', 'item3', extra={'factory': 'f1'})
 
@@ -479,7 +472,6 @@
     >>> adding.hasCustomAddView()
     True
 
-    >>> tearDown()
     """
 
 def test_SingleMenuItem_and_NoCustomAddView_NonICNC():
@@ -489,7 +481,6 @@
     and there is non custom add view . Also the container does not
     implement IContainerNamesContainer
 
-    >>> setUp()
     >>> registerAddMenu()
     >>> defineMenuItem(AddMenu, None, '', 'item3', extra={'factory': ''})
     >>> class F1(object):
@@ -538,7 +529,6 @@
     >>> adding.hasCustomAddView()
     False
 
-    >>> tearDown()
     """
 
 def test_isSingleMenuItem_with_ICNC():
@@ -546,7 +536,6 @@
     This test checks for whether there is a single content that can be added
     and the container uses IContainerNamesContaienr
 
-    >>> setUp()
     >>> registerAddMenu()
     >>> defineMenuItem(AddMenu, None, '', 'item3', extra={'factory': ''})
 
@@ -584,14 +573,12 @@
     >>> adding.hasCustomAddView()
     False
 
-    >>> tearDown()
-
     """
 
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(Test),
-        DocTestSuite(),
+        DocTestSuite(setUp=setUp, tearDown=tearDown),
         ))
 
 if __name__=='__main__':



More information about the Zope3-Checkins mailing list