parameterized test with cartesian product of arguments in pytest
问题 Just wondering, is there any (more) elegant way of parameterizing with the cartesian product? This is what I figured out so far: numbers = [1,2,3,4,5] vowels = ['a','e','i','o','u'] consonants = ['x','y','z'] cartesian = [elem for elem in itertools.product(*[numbers,vowels,consonants])] @pytest.fixture(params=cartesian) def someparams(request): return request.param def test_something(someparams): pass At least I'd like to encapsulate numbers, vowels, consonants and cartesian in the fixture