This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fperez
Recipients Yaroslav.Halchenko, brian.curtin, exarkun, fperez, michael.foord, pitrou
Date 2010-04-09.19:25:44
SpamBayes Score 2.6776293e-06
Marked as misclassified No
Message-id <1270841147.26.0.0922503881651.issue7897@psf.upfronthosting.co.za>
In-reply-to
Content
Hey Yarick,

On Thu, Apr 8, 2010 at 18:53, Yaroslav Halchenko <report@bugs.python.org> w=
rote:
> In PyMVPA we have our little decorator as an alternative to Fernando's ge=
nerators, =A0and which is closer, I think, to what Michael was wishing for:
> @sweepargs
>
> http://github.com/yarikoptic/PyMVPA/blob/master/mvpa/testing/sweepargs.py
>
> NB it has some minor PyMVPA specificity which could be easily wiped out, =
and since it was at most 4 eyes looking at it and it bears "evolutionary" c=
hanges, it is far from being the cleanest/best piece of code, BUT:
>
> * it is very easy to use, just decorate a test method/function and give a=
n argument which to vary within the function call, e.g smth like
>
> @sweepargs(arg=3Drange(5))
> def test_sweepargs_demo(arg):
> =A0 =A0ok_(arg < 5)
> =A0 =A0ok_(arg < 3)
> =A0 =A0ok_(arg < 2)
>
> For nose/unittest it would still look like a single test

Thanks for the post; I obviously defer to Michael on the final
decision, but I *really* would like a solution that reports an
'argument sweep' as multiple tests, not as one.  They are truly
multiple tests (since they can pass/fail independently), so I think
they should be treated as such.

On the other hand, your code does have nifty features that could be
used as well, so perhaps the best of both can be used in the end.

Cheers,

f
History
Date User Action Args
2010-04-09 19:25:47fperezsetrecipients: + fperez, exarkun, pitrou, michael.foord, brian.curtin, Yaroslav.Halchenko
2010-04-09 19:25:47fperezsetmessageid: <1270841147.26.0.0922503881651.issue7897@psf.upfronthosting.co.za>
2010-04-09 19:25:45fperezlinkissue7897 messages
2010-04-09 19:25:44fperezcreate