def __init__(self, reason, test, tags, results, lineno, retry_on_failure=False): """Constructor for expectations. Args: reason: String that indicates the reason for the expectation. test: String indicating which test is being affected. tags: List of tags that the expectation applies to. Tags are combined using a logical and, i.e., all of the tags need to be present for the expectation to apply. For example, if tags = ['Mac', 'Debug'], then the test must be running with the 'Mac' and 'Debug' tags set; just 'Mac', or 'Mac' and 'Release', would not qualify. results: List of outcomes for test. Example: ['Skip', 'Pass'] """ assert python_2_3_compat.is_str(reason) or reason is None assert python_2_3_compat.is_str(test) self._reason = reason self._test = test self._tags = frozenset(tags) self._results = frozenset(results) self._lineno = lineno self.should_retry_on_failure = retry_on_failure
def __init__(self, reason=None, test='*', tags=None, results=None, lineno=0, retry_on_failure=False, is_slow_test=False, conflict_resolution=ConflictResolutionTypes.UNION, raw_tags=None, raw_results=None, is_glob=False, trailing_comments=None): """Constructor for expectations. Args: reason: String that indicates the reason for the expectation. test: String indicating which test is being affected. tags: List of tags that the expectation applies to. Tags are combined using a logical and, i.e., all of the tags need to be present for the expectation to apply. For example, if tags = ['Mac', 'Debug'], then the test must be running with the 'Mac' and 'Debug' tags set; just 'Mac', or 'Mac' and 'Release', would not qualify. results: List of outcomes for test. Example: ['Skip', 'Pass'] """ tags = tags or [] self._is_default_pass = not results results = results or {ResultType.Pass} reason = reason or '' trailing_comments = trailing_comments or '' assert python_2_3_compat.is_str(reason) assert python_2_3_compat.is_str(test) self._reason = reason self._test = test self._tags = frozenset(tags) self._results = frozenset(results) self._lineno = lineno self._raw_tags = raw_tags self._raw_results = raw_results self.should_retry_on_failure = retry_on_failure self.is_slow_test = is_slow_test self.conflict_resolution = conflict_resolution self._is_glob = is_glob self._trailing_comments = trailing_comments