pytest_cases/common_pytest.py
def cart_product_pytest(argnames, argvalues):
    """
     - do NOT use `itertools.product` as it fails to handle MarkDecorators
     - we also unpack tuples associated with several argnames ("a,b") if needed
     - we also propagate marks

    :param argnames:
    :param argvalues:
    :return:
    """
    # transform argnames into a list of lists
    argnames_lists = [get_param_argnames_as_list(_argnames) if len(_argnames) > 0 else [] for _argnames in argnames]

    # make the cartesian product per se
    argvalues_prod = _cart_product_pytest(argnames_lists, argvalues)

    # flatten the list of argnames
    argnames_list = [n for nlist in argnames_lists for n in nlist]

    # apply all marks to the arvalues
    argvalues_prod = [make_marked_parameter_value(tuple(argvalues), marks=marks) if len(marks) > 0 else tuple(argvalues)
                      for marks, argvalues in argvalues_prod]

    return argnames_list, argvalues_prod

     - do NOT use `itertools.product` as it fails to handle MarkDecorators
     - we also unpack tuples associated with several argnames ("a,b") if needed
     - we also propagate marks

    :param argnames:
    :param argvalues:
    :return:
    
do NOT use `itertools.product` as it fails to handle MarkDecorators
we also unpack tuples associated with several argnames ("a,b") if needed
we also propagate marks
do NOT use ` itertools . product ` as it fails to handle MarkDecorators we also unpack tuples associated with several argnames ( " a b " ) if needed we also propagate marks
def cart_product_pytest(argnames, argvalues):
    argnames_lists = [get_param_argnames_as_list(_argnames) if len(_argnames) > 0 else [] for _argnames in argnames]
    argvalues_prod = _cart_product_pytest(argnames_lists, argvalues)
    argnames_list = [n for nlist in argnames_lists for n in nlist]
    argvalues_prod = [make_marked_parameter_value(tuple(argvalues), marks=marks) if len(marks) > 0 else tuple(argvalues)
                      for marks, argvalues in argvalues_prod]
    return argnames_list, argvalues_prod
def cart_product_pytest ( argnames , argvalues ) : argnames_lists = [ get_param_argnames_as_list ( _argnames ) if len ( _argnames ) > 0 else [ ] for _argnames in argnames ] argvalues_prod = _cart_product_pytest ( argnames_lists , argvalues ) argnames_list = [ n for nlist in argnames_lists for n in nlist ] argvalues_prod = [ make_marked_parameter_value ( tuple ( argvalues ) , marks = marks ) if len ( marks ) > 0 else tuple ( argvalues ) for marks , argvalues in argvalues_prod ] return argnames_list , argvalues_prod
do NOT use `itertools.product` as it fails to handle MarkDecorators
 we also unpack tuples associated with several argnames ("a,b") if needed
 we also propagate marks
do NOT use ` itertools . product ` as it fails to handle MarkDecorators we also unpack tuples associated with several argnames ( " a b " ) if needed we also propagate marks
"""
     - do NOT use `itertools.product` as it fails to handle MarkDecorators
     - we also unpack tuples associated with several argnames ("a,b") if needed
     - we also propagate marks

    :param argnames:
    :param argvalues:
    :return:
    """ # transform argnames into a list of lists # make the cartesian product per se # flatten the list of argnames # apply all marks to the arvalues
None
argnames
None
argvalues
None