Re: zope.testbrowser and WebTest

Brian Sutherland <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Thu, Dec 16, 2010 at 12:06:36AM +0100, Hanno Schlichting wrote:
> On Wed, Dec 15, 2010 at 2:06 PM, Brian Sutherland
> <[email protected]> wrote:
> > I've managed to get the existing tests to run against this browser with
> > two new testing dependencies:
> >    WebTest
> >    zope.app.wsgi
> 
> zope.app.wsgi shouldn't be a dependency of zope.testbrowser. It's ok
> if it's pulled in via a specific extra_requires like a [webtest]
> extra, though. Zope2 depends on zope.testbrowser and has no dependency
> on any zope.app packages - this must continue to be the case. Required
> test dependencies count towards real dependencies here.

I understand your point, but the situation was already pretty nasty as 
zope.testbrowser already depended on:

    zope.app.appsetup
    zope.app.publication
    zope.app.testing >= 3.8

I agree that any extra dependency is not welcome, but this feature opens
up a path to radically reducing the dependencies of zope.testbrowser.
See below.

> The real fix would probably be to move the reusable code out of
> zope.app.wsgi into a zope.wsgi package, but that might be more than
> you are willing to do now. I do believe some of the Grok people would
> be interested in this as well.

There is also another route open now with the addition of the webtest
feature. We could invert the zope.testbrowser -> zope.app.testing
dependency.

This is a major re-factoring, but will leave the zope.testbrowser
dependencies looking like this:

    install_requires = [
        'mechanize>=0.2.0',
        'setuptools',
        'zope.interface',
        'zope.schema',
        'pytz',
        ],
    extras_require = {
        'test': [
            'WebOb',
            'WebTest',
                ]

Basically this would require:

    * Re-writing the zope.testbrowser.ftests test application as a pure
      WSGI app (using WebOb)
    * Test only against zope.testbrowser.wsgi and refactor tests to not
      use features from zope.app.testing.functional
    * Move zope.testbrowser.testing into zope.testbrowser.wsgi and
      zope.app.testing.testbrowser
    * Leave backwards compatibility imports in place in
      zope.testbrowser.testing

I'd be willing to have a look at this if Benji were OK in principle on
this and someone was willing to review it.

-- 
Brian Sutherland
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.