[pytest-dev] Alias to parametrize

Matt Griswold grizz at 20c.com
Tue Jan 30 00:28:29 EST 2018


* Floris Bruynooghe <flub at devork.be> [180129 19:08 -0800]:
> However the serious note in that plugin is that I think it makes sense
> to use ``params``.  My reasoning is that it's easy to spell and
> already used for fixtures: ``@pytest.fixture(params=[0, 1])``.  So
> why not everywhere else:  ``@pytest.mark.params('a', [0, 1])``,
> ``metafunc.params(...)``.  So to be honest I think we should migrate
> to that and still disallow the other variants.  It would mean I don't
> get to release my fun plugin but whatever.

That makes a lot of sense to me, although I'm not a pytest developer
and have no idea what the pytest rules for making backward incompatible
changes are.

After reading this thread, I chimed in on GitHub -- aliases are almost
never a good idea, but the fact that there's an alt_spellings list in
the code means that it really should just be renamed. This should be as
simple as a deprecation warning, time period, and users doing a
s/parametrize/params/.

Cheers


More information about the pytest-dev mailing list