[pytest-dev] parametrization ids simplification/generalization

Brianna Laugher brianna.laugher at gmail.com
Tue Oct 22 02:57:07 CEST 2013


Hi,

I don't mind losing the IDs constructed from values, assuming it will still
be possible to specify IDs if using metafunc.addcall. But if we are going
to lose the IDs from values then they should probably just be plain
integers (as happens when using metafunc.addall without specifying id) -
having names like test_some[arg0-arg1-arg2],  test_some[arg3-arg4-arg5] etc
is totally pointless.

thanks
Brianna



On 21 October 2013 23:12, holger krekel <holger at merlinux.eu> wrote:

> Hi Brianna, all,
>
> I am thinking about constructing ids for parametrized tests using
> argname/valindex, i.e. not use the actual parametrization
> values.  The latter causes some problems (among them also issue357)
> and generally doesn't allow to distinguish the two tests in:
>
>     @pytest.mark.parametrize("arg", [1,1])
>     def test_some(arg):
>         pass
>
> Currently this gives two identical test ids "test_some[1]".
> With the new scheme this gives:
>
>     test_some[arg0]
>     test_some[arg1]
>
> Such a scheme would guarantee unique IDs.  The scheme is already
> used for user instances.
>
> Note that when you get a traceback you would still see the actual
> argument values in the traceback.
>
> Any objections?
>
> holger
>



-- 
They've just been waiting in a mountain for the right moment:
http://modernthings.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20131022/11777404/attachment.html>


More information about the Pytest-dev mailing list