[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/session/ Don't use
ztapi anymore, and the doctest does the setup,
so should do the teardown too
Martijn Pieters
mj at zopatista.com
Sun Jul 30 13:13:47 EDT 2006
Log message for revision 69300:
Don't use ztapi anymore, and the doctest does the setup, so should do the teardown too
Changed:
U Zope3/trunk/src/zope/app/session/http.py
U Zope3/trunk/src/zope/app/session/tests.py
-=-
Modified: Zope3/trunk/src/zope/app/session/http.py
===================================================================
--- Zope3/trunk/src/zope/app/session/http.py 2006-07-30 12:52:13 UTC (rev 69299)
+++ Zope3/trunk/src/zope/app/session/http.py 2006-07-30 17:13:46 UTC (rev 69300)
@@ -290,8 +290,7 @@
... self.request_id = id
...
>>> manager = DummyManager()
- >>> from zope.app.testing import ztapi
- >>> ztapi.provideUtility(IClientIdManager, manager)
+ >>> component.provideUtility(manager, IClientIdManager)
>>> from zope.publisher.http import HTTPRequest
>>> class DummyEvent (object):
... request = HTTPRequest(StringIO(''), {}, None)
@@ -311,6 +310,11 @@
>>> manager.request_id
'bar'
+ Cleanup of the utility registration:
+
+ >>> import zope.component.testing
+ >>> zope.component.testing.tearDown()
+
"""
# the event sends us a IHTTPApplicationRequest, but we need a
# IHTTPRequest for the response attribute, and so does the cookie-
Modified: Zope3/trunk/src/zope/app/session/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/session/tests.py 2006-07-30 12:52:13 UTC (rev 69299)
+++ Zope3/trunk/src/zope/app/session/tests.py 2006-07-30 17:13:46 UTC (rev 69300)
@@ -89,15 +89,11 @@
''' % (open(os.path.join(os.path.dirname(__file__), 'api.txt')).read(),)
-def sessionTestTearDown(test=None):
- ztapi.unprovideUtility(IClientIdManager)
-
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBootstrap))
suite.addTest(doctest.DocTestSuite())
- suite.addTest(doctest.DocTestSuite('zope.app.session.session',
- tearDown=sessionTestTearDown))
+ suite.addTest(doctest.DocTestSuite('zope.app.session.session'))
suite.addTest(doctest.DocTestSuite('zope.app.session.http'))
return suite
More information about the Zope3-Checkins
mailing list