[pytest-dev] how to handle 'parameterize' misspelling

Brianna Laugher brianna.laugher at gmail.com
Tue Mar 10 12:38:19 CET 2015


Ok cool. I agree, as we don't know for sure when the registered-markers
thing will happen, this is still worth doing in the meantime.

Thanks
Brianna
On 10/03/2015 10:26 AM, "holger krekel" <holger at merlinux.eu> wrote:

> Hi Brianna,
>
> On Mon, Mar 09, 2015 at 23:25 +0100, Brianna Laugher wrote:
> > Hello,
> >
> >
> https://bitbucket.org/pytest-dev/pytest/issue/463/add-alias-for-parametrize-or-provide
> >
> > It is, I think, a relatively common and easy error for someone to type
> > 'pytest.mark.parameterize' instead of 'pytest.mark.parametrize'. At the
> > moment doing so (wrongly putting an extra 'e') results in an error like*
> > "fixture 'arg' not found" *which is not very revealing as to what the
> > problem actually is.
> >
> > Two reasonable options would be
> > 1) Treat parameterize as an alias of parametrize, so they behave
> identically
> > 2) Check for the misspelling and raise a specific error about it
> >
> > What are people's thoughts about the best approach?
>
> For now 2) seems like a direct worthwhile fix/help to me.
>
> FWIW I have a long-standing refactoring for markers which was at some point
> 95% complete (and discussed with Floris and others at a previous Pycon).
> It would make registering markers much easier.  But waiting for it is
> probably no the right strategy.
>
> With the refactoring in place i'd feel more comfortable with issuing
> warnings on non-registered markers.  Currently, marker registration
> is a bit too clunky IMHO.
>
> holger
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20150310/06b0e723/attachment.html>


More information about the pytest-dev mailing list