pytest_cases/case_funcs_new.py
def matches_tag_query(case_fun,
                      has_tag=None,  # type: Union[str, Iterable[str]]
                      filter=None,   # type: Union[Callable[[Iterable[Any]], bool], Iterable[Callable[[Iterable[Any]], bool]]]  # noqa
                      ):
    """
    Returns True if the case function is selected by the query:

     - if `has_tag` contains one or several tags, they should ALL be present in the tags
       set on `case_fun` (`case_fun._pytestcase.tags`)

     - if `filter` contains one or several filter callables, they are all called in sequence and the
       case_fun is only selected if ALL of them return a True truth value

    :param case_fun:
    :param has_tag:
    :param filter:
    :return: True if the case_fun is selected by the query.
    """
    selected = True

    # query on tags
    if has_tag is not None:
        selected = selected and CaseInfo.get_from(case_fun).matches_tag_query(has_tag)

    # filter function
    if filter is not None:
        if not isinstance(filter, (tuple, set, list)):
            filter = (filter,)

        for _filter in filter:
            # break if already unselected
            if not selected:
                return selected

            # try next filter
            try:
                res = _filter(case_fun)
                # keep this in the try catch in case there is an issue with the truth value of result
                selected = selected and res
            except:  # noqa
                # any error leads to a no-match
                selected = False

    return selected

    Returns True if the case function is selected by the query:

     - if `has_tag` contains one or several tags, they should ALL be present in the tags
       set on `case_fun` (`case_fun._pytestcase.tags`)

     - if `filter` contains one or several filter callables, they are all called in sequence and the
       case_fun is only selected if ALL of them return a True truth value

    :param case_fun:
    :param has_tag:
    :param filter:
    :return: True if the case_fun is selected by the query.
    


if `filter` contains one or several filter callables, they are all called in sequence and the
case_fun is only selected if ALL of them return a True truth value
if ` filter ` contains one or several filter callables they are all called in sequence and the case_fun is only selected if ALL of them return a True truth value
def matches_tag_query(case_fun,
                      has_tag=None,  
                      filter=None,   
                      ):
    selected = True
    if has_tag is not None:
        selected = selected and CaseInfo.get_from(case_fun).matches_tag_query(has_tag)
    if filter is not None:
        if not isinstance(filter, (tuple, set, list)):
            filter = (filter,)
        for _filter in filter:
            if not selected:
                return selected
            try:
                res = _filter(case_fun)
                selected = selected and res
            except:  
                selected = False
    return selected
def matches_tag_query ( case_fun , has_tag = None , filter = None , ) : selected = True if has_tag is not None : selected = selected and CaseInfo . get_from ( case_fun ) . matches_tag_query ( has_tag ) if filter is not None : if not isinstance ( filter , ( tuple , set , list ) ) : filter = ( filter , ) for _filter in filter : if not selected : return selected try : res = _filter ( case_fun ) selected = selected and res except : selected = False return selected
Returns True if the case function is selected by the query:
 if `has_tag` contains one or several tags, they should ALL be present in the tags
set on `case_fun` (`case_fun._pytestcase.tags`)
Returns True if the case function is selected by the query : if ` has_tag ` contains one or several tags they should ALL be present in the tags set on ` case_fun ` ( ` case_fun . _pytestcase . tags ` )
# type: Union[str, Iterable[str]] # type: Union[Callable[[Iterable[Any]], bool], Iterable[Callable[[Iterable[Any]], bool]]]  # noqa """
    Returns True if the case function is selected by the query:

     - if `has_tag` contains one or several tags, they should ALL be present in the tags
       set on `case_fun` (`case_fun._pytestcase.tags`)

     - if `filter` contains one or several filter callables, they are all called in sequence and the
       case_fun is only selected if ALL of them return a True truth value

    :param case_fun:
    :param has_tag:
    :param filter:
    :return: True if the case_fun is selected by the query.
    """ # query on tags # filter function # break if already unselected # try next filter # keep this in the try catch in case there is an issue with the truth value of result # noqa # any error leads to a no-match
True if the case_fun is selected by the query.
True if the case_fun is selected by the query .
case_fun
None
has_tag
None
filter
None