Пример #1
0
    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
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
 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)
Пример #5
0
    def _positive_frame_match(self, match_frame, platform, exception_data,
                              cache):

        return cached(cache, glob_match, match_frame["function"],
                      self._encoded_pattern)