Closed
Description
The current syntax for providing an id along with a parameter set is:
@pytest.mark.parameterize('a,b', [
pytest.param(1, 3, id='odds'),
pytest.param(2, 4, id='evens'),
])
def test_something(a, b):
...
I'd like to get peoples' opinions about an alternative syntax:
@pytest.mark.parameterize('a,b', {
'odds': (1, 3),
'evens': (2, 4),
})
def test_something(a, b):
...
The rationale, other than the alternative being shorter, is that (it seems to me) that mappings are natural for pairing identifiers and data. If we have to decide on a way to interpret someone passing a mapping into argvalues
, I think that'll be a natural one.
P.S. currently, if you pass a dictionary as argvalues
, its keys are iterated and the values are discarded