[py-dev] Autoactive fixtures

Floris Bruynooghe flub at devork.be
Sat Oct 6 00:42:11 CEST 2012


Hi Holger,

One nice feature of the funcarg/setup merge into fixture is that you
can now return a value from an autoactive fixture and request it
anywhere else.  I didn't think of this before but this is surprisingly
useful as it provides a great alternative to storing things on e.g.
session or item objects.

However one issue I discovered is that is possible for a user to
accidentally override an autoactive fixture.  If you create a fixture
with an identical name to the autoactive one it will be lost.  I think
this can be problematical for plugins.

What do you think the correct behaviour should be?  I realise changing
this could be hard/ugly.

Regards,
Floris



More information about the Pytest-dev mailing list