Jordan Cook
Jordan Cook
By the way, you're one of the first people besides myself to use this tool, so I appreciate the suggestions!
Yes! I think the [`stale_if_error`](https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#expiration-and-error-handling) setting is what you're looking for. Let me know if that does what you want.
Oh, I missed the part about needing to use `force_refresh=True`. That will always skip reading from the cache, so it will take precedence over `stale_if_error`. Let me think about the...
Instead of `force_refresh`, you could set requests to expire immediately: ```py from requests_cache import CachedSession, EXPIRE_IMMEDIATELY backend = SQLiteCache(use_cache_dir=True) session = CachedSession( backend=backend, expire_after=EXPIRE_IMMEDIATELY, stale_if_error=True, ) ```
I'm not able to reproduce this locally. Previous versions of requests-cache didn't handle an empty JSON array correctly, but I believe that was fixed in 1.1. If you have cached...
Thanks for the details! I'll get that fixed soon; meanwhile, a workaround you can use is `decode_content=False`.
The main problem here has been fixed in v1.2.1. However, the comparison `original_response == cached_response` will still fail. The original response body will have a trailing newline, but since `decode_content=True`...
It looks like you may be missing pymongo.
Yes! Pytest has a few handy features for selecting or ignoring specific tests, including [`--ignore`](https://docs.pytest.org/en/7.1.x/example/pythoncollection.html?highlight=ignore) and [`-k`](https://docs.pytest.org/en/7.1.x/example/markers.html#using-k-expr-to-select-tests-based-on-their-name) (similar to the `-m` you're already using, but with substring matching). For example:...
I'm assuming installing or updating pymongo will fix your original error, but let me know if it doesn't.