def test_kwargs(self): """Order of kwargs should not matter""" def foo(**kwargs): foo.call_count += 1 foo.call_count = 0 cache = {} cached(cache, foo, kw1=1, kw2=2) assert foo.call_count == 1 # Call with different kwargs order - call_count is still one: cached(cache, foo, kw2=2, kw1=1) assert foo.call_count == 1
def _positive_frame_match(self, match_frame, platform, exception_data, cache): field = match_frame[self.field] if field is None: return False return cached(cache, glob_match, field, self._encoded_pattern)
def _positive_frame_match(self, match_frame, platform, exception_data, cache): value = match_frame[self.field] if value is None: return False return cached(cache, path_like_match, self._encoded_pattern, value)
def _positive_frame_match(self, frame_data, platform, exception_data, cache): field = get_path(exception_data, *self.field_path) or "<unknown>" return cached(cache, glob_match, field, self._encoded_pattern)
def _positive_frame_match(self, match_frame, platform, exception_data, cache): return cached(cache, glob_match, match_frame["function"], self._encoded_pattern)