parameterized
parameterized copied to clipboard
Is it possible to stack decorators to create a matrix similar to pytest.mark.parameterize?
Ex:
@parameterized.expand([(True,), (False,)])
@parameterized.expand([(0,), (1,)])
def test_test(_bool, _num):
"""
would get:
True 0
False 0
True 1
False 1
"""
Similar to #102
This feature would be nice, but in the meantime I am using itertools.product(), so your example above would look something like:
import itertools
...
@parameterized.expand(itertools.product([True, False], [0, 1], repeat=1))
def test_test(_bool, _num):
...
Alternative syntax you can use for this without itertools.product() is:
@parameterized.expand(
(_bool, _num)
for _bool in (True, False)
for _num in (0, 1)
)
def test_test(_bool, _num):
...