def get_test_ids_from_param_values(param_names,
                                   param_values,
                                   ):
    """
    Replicates pytest behaviour to generate the ids when there are several parameters in a single `parametrize`

    :param param_names:
    :param param_values:
    :return: a list of param ids
    """
    nb_params = len(param_names)
    if nb_params == 0:
        raise ValueError("empty list provided")
    elif nb_params == 1:
        paramids = list(str(v) for v in param_values)
    else:
        paramids = []
        for vv in param_values:
            if len(vv) != nb_params:
                raise ValueError("Inconsistent lenghts for parameter names and values: '%s' and '%s'"
                                 "" % (param_names, vv))
            paramids.append('-'.join([str(v) for v in vv]))
    return paramids