Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename parametrize to params? #4506

Closed
obestwalter opened this issue Dec 4, 2018 · 6 comments
Closed

Rename parametrize to params? #4506

obestwalter opened this issue Dec 4, 2018 · 6 comments
Labels
topic: marks related to marks, either the general marks or builtin topic: parametrize related to @pytest.mark.parametrize type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@obestwalter
Copy link
Member

obestwalter commented Dec 4, 2018

The spelling of pytest.mark.parametrize is a constant source of confusion as it could just as well be parameterize, parameterise or parametrise.

How about using a short form that avoids the spelling confusion? As we already have params as keyword argument to paramet[e]ri[z|s]e fixtures, we could reuse that and have pytest.mark.params instead.

@rth
Copy link

rth commented Dec 4, 2018

+1. Also pytest.mark.parametr<anything>(args) return a valid object,

>>> pytest.mark.parameterize_incorrect('x', [2, 3])
MarkDecorator(mark=Mark(name='parameterize_incorrect', args=('x', [2, 3]), kwargs={}))

which only adds to the confusion, in my experience.

@RonnyPfannschmidt
Copy link
Member

i propose making "strict" the default and falling flat on unknown marks instead

@Zac-HD
Copy link
Member

Zac-HD commented Dec 5, 2018

I propose making "strict" the default and falling flat on unknown marks instead

This is definitely my preference, as "There should be one-- and preferably only one --obvious way to do it."

@Zac-HD Zac-HD added type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature topic: parametrize related to @pytest.mark.parametrize topic: marks related to marks, either the general marks or builtin labels Dec 5, 2018
@obestwalter
Copy link
Member Author

Yes. Strict marker checking by default would also remove a lot of footguns.

@obestwalter
Copy link
Member Author

Closing this as solved (in a better way) by #4826 - thanks @Zac-HD :)

@c32hedge
Copy link

I would argue that parametrize is a misspelling that it would still be nice to get fixed. We're dealing with function parameters not parametric curves. It's great to get a warning, but it would be nice to fix the common, constant source of confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: marks related to marks, either the general marks or builtin topic: parametrize related to @pytest.mark.parametrize type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

5 participants