def pytest_generate_tests(metafunc):
    # number of test to repeat
    test_indices = range(1)

    # test params
    test_funcs = [
        TestFuncs.func_dot_reduction_mix,
        TestFuncs.func_dot_reduction_transpose_mix,
    ]
    test_tensor_flags = ['pos_rand', 'neg_rand', 'rand']
    test_tensor_dims = [(2, 2)]

    # generate params for testing
    if 'custom_args' in metafunc.fixturenames:
        fargs = itertools.product(test_indices,
                                  test_funcs,
                                  test_tensor_flags,
                                  test_tensor_dims)
        # parameterize test call
        metafunc.parametrize("custom_args", fargs)
Test generator
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/tests/test_compound_optree.py/pytest_generate_tests