[Zope-dev] Test fixture concepts

Wolfgang Schnerring ws at gocept.com
Mon Mar 28 10:56:09 EDT 2011


Hello,

* Martin Aspeli <optilude+lists at gmail.com> [2011-03-27 16:13]:
> On 27 March 2011 15:54, Uli Fouquet <uli at gnufix.de> wrote:
> > The (limited) experiences with py.test, however, were awesome. Some
> > points that are quite cool IMHO: [...]

I agree wholeheartedly with what Martin has said about py.test vs.
zope.testrunner.

> > - Lots of setup code (unrelated to fixtures) can simply be skipped. No
> > need to do the ``testsuite = <complex-testcase-collecting>`` over and
> > over again. Maybe the main point of py.test.
> You don't need that for zope.testrunner either, of course, at least
> not when using unittest base classes.

This is a point that bears repeating, though: test_suite() is *not
needed* since zope.testing-3.8.0 (2009-07-24) for descendants of
unittest.TestCase.

> FWIW, I think we should stop using .txt doctests for unit tests.
> Doctests should be used to test *documentation* ("the examples are
> valid"). For actual unit tests, writing tests in a unittest class is
> almost always better in the long run.

+lots and lots and lots,
especially since you've formulated it in quite a balanced way.

> > For now I think that there is absolutely no need to think about a
> > general move to py.test for the ztk.
> 
> I think there's benefit in unifying the concepts and support for
> concepts like layers so that people can use the test runner they
> prefer.

How can we make progress here? I'm not sure whether this calls for
some green field sketching, "how should test fixture setup work?" or
some hands-on experimentation, "let's see how we get some existing
test layers to run under py.test", or both, or something else
entirely.

Wolfgang


More information about the Zope-Dev mailing list