[Grok-dev] Grok, testing and test setups

Christian Klinger cklinger at novareto.de
Tue Jan 4 15:57:20 EST 2011


Hey Uli, Hey Martijn;

today i experimented a bit with zope.pytest.

I started with a fresh grokproject.
I added pytest and zope.pytest to the buildout.
And i created three kind of tests:

  - unit
  - integration
  - functional (infrae.testbrowser)

All of them seems to work. And the testsetup is really easy.
Ok next thing i want to explore is the metafunc_object stuff.

Christian


You can find the buildout here [1]

[1] svn+ssh://svn.zope.org/repos/main/Sandbox/cklinger/pytt


> Hi there,
>
> Thanks to Giampaolo Rodolà, who noticed that the current Grok reference
> docs are pretty outdated concerning tests and test setups, I found out
> that also the current grokproject generated tests (i.e. the tests and
> test setups in created projects) are broken. See:
>
>    https://bugs.launchpad.net/bugs/677401
>
> All this, of course, needs a major upgrade and I am currently working on
> that.
>
> While thinking about and discussing that it came to mind that our usual
> approaches with z3c.testsetup (for grokproject generated projects) or
> zope.testing-based testing (for grokcore.*, megrok.* projects) might not
> be 'state of the art' anymore.
>
> Many other Python-based webframeworks meanwhile switched to py.test or
> nose for discovering and executing tests. This way they benefit from
> many extensions, a broad developer community and more goodies, one
> certainly want to have. Maybe it's time for Grok to switch too.
>
> The main problem for introducing such enhanced testing libraries in a
> Grok/Zope environment might be the setup of functional tests with all
> the ZODB handling, ZCML registrations, etc. Fortunately, Martijn already
> wrote some code to ease that task for py.test and he is willing to share
> that, most probably in a new package 'zope.pytest' (many thanks,
> Martijn!).
>
> My plan for documentation and grokproject is roughly to
>
> 1) prepare and release zope.pytest
>
> 2) explain/introduce py.test based test setups based on zope.pytest and
>     kick zope.testing as well as z3c.testsetup in docs and grokproject.
>
> Once we have a 'common' way for testing/test setups, one _could_ start
> to switch also grokcore.*, megrok.* projects step by step to py.test,
> nose or something different.
>
> As I am not too experienced yet with py.test (but Martijn, who already
> uses py.test in active projects told it is very well thought) or nose,
> I'd hereby want to ask for co-developers and general remarks/input
> concerning that topic.
>
> We might want to discuss that also at next IRC meeting.
>
> Please tell what you think!
>
> Best regards and a merry christmas to everybody,
>
>
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev




More information about the Grok-dev mailing list