Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -18,7 +18,7 @@
Loading
18 18
    miss_callable=None,
19 19
    key_generator_callable=None,
20 20
    store_result=True,
21 -
    cache_exceptions=None,
21 +
    cache_exceptions=(),
22 22
    cache_alias=DEFAULT_CACHE_ALIAS,
23 23
):
24 24
    """Decorator for memoizing function calls where we use the
@@ -35,7 +35,7 @@
Loading
35 35
    :arg bool store_result: If you know the result is not important, just
36 36
    that the cache blocked it from running repeatedly, set this to False.
37 37
    :arg bool cache_exceptions: Any exception raised from classes provided in
38 -
    this list will be cached, all other will be propagated.
38 +
    this tuple will be cached, all other will be propagated.
39 39
    :arg string cache_alias: The cache alias to use; defaults to 'default'.
40 40
41 41
    Usage::
@@ -121,10 +121,12 @@
Loading
121 121
                result = cache.get(cache_key, MARKER)
122 122
            if result is MARKER:
123 123
124 +
                # If the function all raises an exception we want to cache,
125 +
                # catch it, else let it propagate.
124 126
                try:
125 127
                    result = func(*args, **kwargs)
126 128
                except Exception as exception:
127 -
                    if exception.__class__ in (cache_exceptions or []):
129 +
                    if isinstance(exception, cache_exceptions):
128 130
                        result = exception
129 131
                    else:
130 132
                        raise exception
@@ -141,7 +143,9 @@
Loading
141 143
            elif hit_callable:
142 144
                hit_callable(*args, **kwargs)
143 145
144 -
            if result.__class__ in (cache_exceptions or []):
146 +
            # If the result is an exception we've caught and cached, raise it
147 +
            # in the end as to not change the API of the function we're caching.
148 +
            if isinstance(result, Exception):
145 149
                raise result
146 150
            return result
147 151
Files Coverage
src/cache_memoize/__init__.py 100.00%
Project Totals (1 files) 100.00%
94.3
3.7=.7
TRAVIS_OS_NAME=linux
94.1
3.5=.5
TRAVIS_OS_NAME=linux
94.4
TRAVIS_OS_NAME=linux
pypy3=

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading