[Checkins] SVN: zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/ Added tearDown at the suite registration level and removed it from the README itself.
Souheil CHELFOUH
souheil at chelfouh.com
Thu Feb 18 08:00:19 EST 2010
Log message for revision 109121:
Added tearDown at the suite registration level and removed it from the README itself.
Changed:
U zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/README.txt
U zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/tests.py
-=-
Modified: zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/README.txt
===================================================================
--- zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/README.txt 2010-02-18 12:54:00 UTC (rev 109120)
+++ zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/README.txt 2010-02-18 13:00:19 UTC (rev 109121)
@@ -176,13 +176,7 @@
>>> import shutil
>>> shutil.rmtree(temp_dir)
-We remove our handler::
- >>> from zope.site.hooks import getSiteManager
- >>> getSiteManager().unregisterHandler(handler)
- True
-
-
About WSGI
----------
Modified: zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/tests.py
===================================================================
--- zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/tests.py 2010-02-18 12:54:00 UTC (rev 109120)
+++ zope.app.wsgi/branches/sylvain-testlayers/src/zope/app/wsgi/tests.py 2010-02-18 13:00:19 UTC (rev 109121)
@@ -25,6 +25,7 @@
from zope.testing import doctest
from zope.testing import renormalizing
+import zope.event
import zope.app.wsgi
import zope.publisher.interfaces.browser
from zope.app.publication.requestpublicationregistry import factoryRegistry
@@ -38,6 +39,10 @@
pass
+def cleanEvents(s):
+ zope.event.subscribers.pop()
+
+
class FileView:
interface.implements(zope.publisher.interfaces.browser.IBrowserPublisher)
@@ -107,14 +112,23 @@
])
functional_suite = doctest.DocTestSuite()
functional_suite.layer = AppWSGILayer
+
+ readme_test = doctest.DocFileSuite(
+ 'README.txt',
+ checker=checker, tearDown=cleanEvents,
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
+
doctest_suite = doctest.DocFileSuite(
- 'README.txt', 'fileresult.txt', 'paste.txt',
+ 'fileresult.txt', 'paste.txt',
checker=checker,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
+
+ readme_test.layer = WSGILayer(zope.app.wsgi)
doctest_suite.layer = WSGILayer(zope.app.wsgi)
+
return unittest.TestSuite((
- functional_suite, doctest_suite))
+ functional_suite, readme_test, doctest_suite))
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
More information about the checkins
mailing list