[py-dev] Change behavior in pytest_runtest_setup hooks based on available funcargs

holger krekel holger at merlinux.eu
Thu May 3 03:09:15 CEST 2012


Hi Andreas,

On Wed, May 02, 2012 at 16:26 +0200, Andreas Pelme wrote:
> On Wednesday 2 May 2012 at 15:45, holger krekel wrote:
> 
> > Hi Andreas,
> > 
> > thanks for your mail - i am currently still on travel so haven't
> > digested all details yet. However, I'd like to let you know already that
> > we have a plan to unify (function) Item and FuncargRequest interfaces.
> > This should make it easy to access funcargs from pytest_runtest_setup
> > because 'item' would carry the neccessary API. Maybe there is an
> > intermediate solution for your use case, not sure.
> > 
> > If also Ronny or others don't have another idea it would be great if
> > you opened an issue on making funcargs available in pytest_runtest_setup.
> > 
> > best & thanks,
> > holger
> 
> 
> Holger,
> 
> Thanks for your fast reply. :)

you are welcome!  If you have any other issues or questions related
to the pytest-django plugin i am happy to help.

> I opened an issue: https://bitbucket.org/hpk42/pytest/issue/139/make-it-possible-to-access-funcargs-info

Thanks.

> Are there more info on the unify plan available somewhere?

Apart from some IRC chats with Ronny, no ... he played with
implementing it in some repository IIRC.

The basic idea is simple. Virtually all API of FuncargRequest moves to
the Item and FuncargRequest ceases to exist as a separate concept.
Existing funcarg factories should continue to work of course.

FWIW if somebody else wants to try i am fine to review.  I think it's actually
a fun change because it simplifies things and opens some new possibilities
like introducing a generic "setup_item" function which could do all that
current setup_class/module/function can do, it would have access to
funcarg resources etc. and issues like https://bitbucket.org/hpk42/pytest/issue/137/expose-an-addfinalizer-to-add-callable would be solved as well.

best,
holger


> Best regards/Andreas
> 
> 



More information about the Pytest-dev mailing list