[py-dev] Help understanding pytest_generate_tests related error message
Baptiste Lepilleur
baptiste.lepilleur at gmail.com
Sun May 1 11:59:15 CEST 2011
2011/4/29 Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
> On Fri, 2011-04-29 at 22:18 +0200, Baptiste Lepilleur wrote:
> > [...]
> > I'm not sure how I would go about that: it would means going through
> > the VALIDATION_SCENARIOS test data for each test function, and
> > duplicating some setup code of the test function...
>
> unless i'm misstaken, only the creation of the class is shared
> which means that could actually be something like a funcarg or a param
> to a funcarg
>
Indeed. I did the split but I feel that the scenario types/test function
association is very clumsy:
http://pastebin.com/gTsVJLWK
Is there a simpler way to do this? Ideally, I'd rather have a simple way to
associate a test function with a test parameter generator. I'm thinking of
something like this for example:
@parametrized( _generate_property_validation_tests, ['good_values'] )
def test_property_validation_good_values( scenario_type, dbo_class, value,
good_value ):
...
The parametrized decorator would call _generate_property_validation_tests(
metafunc, ['good_values'] ).
Is there a way to do that?
Thanks,
Baptiste.
>
> -- Ronny
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20110501/8424f174/attachment.html>
More information about the Pytest-dev
mailing list