[Grok-dev] Grok, testing and test setups

Jan-Jaap Driessen jdriessen at thehealthagency.com
Sun Jan 2 10:55:56 EST 2011

Hi Uli,

On 26 December 2010 14:40, Uli Fouquet <uli at gnufix.de> wrote:
> 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!

I agree with your findings. In grokproject, I will replace
z3c.testsetup from with vanilla zope.testunner testsetup and think we
should move to py.test once we have a zope.pytest that properly does
what layers do in zope.testrunner now.

> Best regards and a merry christmas to everybody,
> --
> Uli


Jan-Jaap Driessen

More information about the Grok-dev mailing list