[py-dev] Help understanding pytest_generate_tests related error message
Ronny.Pfannschmidt at gmx.de
Sun May 1 12:29:09 CEST 2011
On Sun, 2011-05-01 at 11:59 +0200, Baptiste Lepilleur wrote:
> 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
> > the VALIDATION_SCENARIOS test data for each test function,
> > 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:
> 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?
you can use the pytest.mark tool to make a decorator which annotates
the value types nicely
> -- Ronny
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: This is a digitally signed message part
More information about the Pytest-dev