[Checkins] SVN: zope.pytest/trunk/src/zope/pytest/setup.py Add docstrings (not finished yet).

Uli Fouquet uli at gnufix.de
Thu Jan 6 10:20:26 EST 2011


Log message for revision 119427:
  Add docstrings (not finished yet).
  

Changed:
  U   zope.pytest/trunk/src/zope/pytest/setup.py

-=-
Modified: zope.pytest/trunk/src/zope/pytest/setup.py
===================================================================
--- zope.pytest/trunk/src/zope/pytest/setup.py	2011-01-06 15:19:41 UTC (rev 119426)
+++ zope.pytest/trunk/src/zope/pytest/setup.py	2011-01-06 15:20:26 UTC (rev 119427)
@@ -20,6 +20,31 @@
 
 
 def create_app(request, site_root):
+    """Get a WSGI publisher application.
+
+    Returns a :class:`zope.app.wsgi.WSGIPublisherApplication` with
+    `site_root` stored in the root folder under the name ``test``.
+
+    This function is meant to be used as setup/teardown handler
+    deploying a ``pytest_funcarg__`` function.
+
+    It sets up a ZODB connection to a ZODB DemoStorage and adds
+    finalizers (`tear_down`-functionality for people from other
+    testing frameworks) to shutdown the whole setup after the test
+    session.
+
+    The `request` parameter is expected to be a py.test
+    :class:`FuncargRequest` (not an HTTP request or similar) which is
+    generated by py.test while running tests.
+    
+    The :attr:`handle_errors` attribute of the returned application is
+    set to ``False`` so that errors are handled by the server.
+
+    To make use of this setup, you have to configure the environment
+    properly before. Most notably you have to register basic
+    components that subscribe to IDatabaseOpenedEvents, etc. This can
+    normally be done using :func:`configure` or :func:`setup_config`.
+    """
     db = setup_db()
     connection = setup_connection(db)
     root = setup_root(connection)



More information about the checkins mailing list