[TIP] py.test doesn't appear to consider testscenarios tests to be distinct tests

Robert Collins robertc at robertcollins.net
Sun Feb 10 14:46:04 PST 2013


On 11 February 2013 11:42, holger krekel <holger at merlinux.eu> wrote:
> Hi Julian,

> however, i guess you are aware of this testscenario/pytest porting snippet:
>
> http://pytest.org/latest/example/parametrize.html#a-quick-port-of-testscenarios
>
> It allows to use pytest with scenario definitions.  It's passing the
> argument in rather than setting an instance attribute.  If you use this
> method, it's also fully compatible with all other pytest options and
> parametrization methods and scopes (see on that page for more examples),
> and of course generally compatible to the fixture dependency injection
> mechanism (http://pytest.org/latest/fixture.html)

Hi Holger, I wasn't aware of that.

Julian, testscenarios.generate_scenarios may help - you can do the
parameterisation at collection time which sounds like it would work
better for py.test.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Cloud Services



More information about the testing-in-python mailing list