[Checkins] SVN: zope.pytest/branches/ extend from ztk, cleanup, remove zope.app.zcmlfiles, use (for now) a checkout of zope.testbrowser to be able to use its wsgi Browser instead of infrae.testbrowser, have the mypkg3 test package configure the necessary components

Jan-Wijbrand Kolman janwijbrand at gmail.com
Sun Mar 13 11:30:12 EDT 2011


Log message for revision 120890:
  extend from ztk, cleanup, remove zope.app.zcmlfiles, use (for now) a checkout of zope.testbrowser to be able to use its wsgi Browser instead of infrae.testbrowser, have the mypkg3 test package configure the necessary components

Changed:
  A   zope.pytest/branches/
  A   zope.pytest/branches/ck-jj-jw-pycon/
  U   zope.pytest/branches/ck-jj-jw-pycon/buildout.cfg
  U   zope.pytest/branches/ck-jj-jw-pycon/setup.py
  U   zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/setup.py
  U   zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/ftesting.zcml
  U   zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/tests/test_browser.py

-=-
Modified: zope.pytest/branches/ck-jj-jw-pycon/buildout.cfg
===================================================================
--- zope.pytest/trunk/buildout.cfg	2011-03-08 21:06:19 UTC (rev 120813)
+++ zope.pytest/branches/ck-jj-jw-pycon/buildout.cfg	2011-03-13 15:30:12 UTC (rev 120890)
@@ -1,20 +1,43 @@
 [buildout]
-develop = . 
-parts = scripts docs devpython
+extends =
+  http://download.zope.org/zopetoolkit/index/1.1/ztk-versions.cfg
+  http://download.zope.org/zopetoolkit/index/1.1/zopeapp-versions.cfg
+develop = .
+parts =
+  scripts
+  docs
+  devpython
 versions = versions
+allow-picked-versions = false
+extensions = mr.developer
+auto-checkout = zope.testbrowser
+sources = sources
 
+[sources]
+zope.testbrowser = svn svn+ssh://svn.zope.org/repos/main/zope.testbrowser/branches/jinty-webtest3
+
 [versions]
+WebTest = 1.2.3
+WebOb = 1.0.4
+cov-core = 1.2
+coverage = 3.4
+execnet = 1.0.8
+py = 1.4.2
+pytest = 2.0.2
+pytest-cov = 1.3
+pytest-xdist = 1.5
+zest.releaser = 3.20
 
 [scripts]
-recipe = zc.recipe.egg
-eggs = 
-    zope.pytest[tests]
-    zest.releaser
-    pytest
-    pytest-cov
+recipe = z3c.recipe.scripts
+eggs =
+  zope.pytest[tests]
+  zest.releaser
+  pytest
+  pytest-cov
 
 [docs]
-recipe = zc.recipe.egg
+recipe = z3c.recipe.scripts
 eggs = zope.pytest[docs]
 dependent-scripts = true
 scripts = sphinx-build sphinx-quickstart

Modified: zope.pytest/branches/ck-jj-jw-pycon/setup.py
===================================================================
--- zope.pytest/trunk/setup.py	2011-03-08 21:06:19 UTC (rev 120813)
+++ zope.pytest/branches/ck-jj-jw-pycon/setup.py	2011-03-13 15:30:12 UTC (rev 120890)
@@ -6,10 +6,12 @@
 tests_require = [
     'pytest',
     'zope.app.appsetup',
-    'zope.app.zcmlfiles',
+    'zope.principalregistry',
+    'zope.authentication',
     'zope.browserpage',
     'zope.securitypolicy',
-    'infrae.testbrowser',
+    'zope.testbrowser',
+    'zope.testbrowser [wsgi]',
     ]
 
 docs_require = tests_require + [
@@ -65,7 +67,7 @@
           'zope.app.wsgi',
           'ZODB3',
           'WebOb',
-          'simplejson'
+#          'simplejson'
           # -*- Extra requirements: -*-
       ],
       extras_require={

Modified: zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/setup.py
===================================================================
--- zope.pytest/trunk/src/zope/pytest/setup.py	2011-03-08 21:06:19 UTC (rev 120813)
+++ zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/setup.py	2011-03-13 15:30:12 UTC (rev 120890)
@@ -5,7 +5,6 @@
 from zope import component
 from zope.event import notify
 from zope.app.publication.zopepublication import ZopePublication
-from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
 
 import zope.processlifetime
 
@@ -35,7 +34,7 @@
     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.
 
@@ -45,7 +44,7 @@
     normally be done using :func:`configure` or :func:`setup_config`.
 
     .. seealso:: `pytest_funcarg__`_ docs on pytest.org.
-    
+
     .. _pytest_funcarg__: http://pytest.org/funcargs.html
     """
     db = setup_db()
@@ -53,10 +52,7 @@
     root = setup_root(connection)
     root['test'] = site_root
 
-    wsgi_app = wsgi.WSGIPublisherApplication(
-        db,
-        HTTPPublicationRequestFactory,
-        True)
+    wsgi_app = wsgi.WSGIPublisherApplication(db)
 
     transaction.commit()
 
@@ -77,7 +73,7 @@
     """Configure the environment.
 
     Performs a ZCML-driven configuration.
-    
+
     The `request` parameter
       is expected to be a py.test
       :class:`FuncargRequest` (not an HTTP request or similar) which is
@@ -101,9 +97,9 @@
     It adds cached setup and teardown code to be run before and after
     your session. That means the configuration setup and teardown will
     happen only once for a complete test run.
-    
+
     .. seealso:: `pytest_funcarg__`_ docs on pytest.org.
-    
+
     .. _pytest_funcarg__: http://pytest.org/funcargs.html
 
     """
@@ -162,7 +158,7 @@
     You normally have to configure the Zope Component Architechture
     using :func:`setup_config` or (preferably) :func:`configure`
     before you call this function.
-    
+
     Returns a ZODB DB.
     """
     name = 'main'
@@ -206,7 +202,7 @@
     `connection`
       is a (normally open) ZODB_ DB connection as returned by
       :func:`setup_connection`.
-    
+
     Aborts any running transaction and closes the connection.
     """
     transaction.abort()

Modified: zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/ftesting.zcml
===================================================================
--- zope.pytest/trunk/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/ftesting.zcml	2011-03-08 21:06:19 UTC (rev 120813)
+++ zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/ftesting.zcml	2011-03-13 15:30:12 UTC (rev 120890)
@@ -12,9 +12,12 @@
   <include package="zope.browserpage" file="meta.zcml" />
   <include package="zope.app.publication" file="meta.zcml" />
   <include package="zope.securitypolicy" file="meta.zcml" />
+  <include package="zope.principalregistry" file="meta.zcml" />
 
+  <include package="zope.authentication"/>
+  <include package="zope.principalregistry"/>
+  <include package="zope.app.publication" />
   <include package="zope.app.wsgi" />
-  <include package="zope.app.zcmlfiles" />
 
   <include package="mypkg3" file="configure.zcml" />
 

Modified: zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/tests/test_browser.py
===================================================================
--- zope.pytest/trunk/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/tests/test_browser.py	2011-03-08 21:06:19 UTC (rev 120813)
+++ zope.pytest/branches/ck-jj-jw-pycon/src/zope/pytest/tests/sample_fixtures/browser/mypkg3/tests/test_browser.py	2011-03-13 15:30:12 UTC (rev 120890)
@@ -4,9 +4,9 @@
 from zope.component import getMultiAdapter
 from zope.publisher.browser import TestRequest
 from zope.pytest import configure, create_app
+from zope.testbrowser.wsgi import Browser
 from mypkg3.app import SampleApp
 
-
 def pytest_funcarg__apps(request):
     app = SampleApp()
     return app, create_app(request, app)
@@ -29,11 +29,10 @@
     assert response.status == "200 Ok"
 
 @pytest.mark.xfail("sys.version_info < (2,6)")
-def test_infrae_browser(config, apps):
+def test_zope_browser(config, apps):
     # Late import. This import will fail with Python < 2.6
-    from infrae.testbrowser.browser import Browser
     zope_app, wsgi_app = apps
-    browser = Browser(wsgi_app)
+    browser = Browser(wsgi_app=wsgi_app)
     browser.open('http://localhost/test/index.html')
     assert browser.contents == 'Hello from SampleAppView!'
-    assert browser.status == '200 Ok'
+    assert browser.headers['Status'] == '200 Ok'



More information about the checkins mailing list