I recently switched from beaker to dogpile.cache. It works very well in live code but I am running into an issue with testing. How do I disable the caching for testing?
I am currently using
#caching.py
from dogpile.cache import make_region
region = make_region().configure(
'dogpile.cache.redis',
expiration_time = 3600,
arguments = {
'host': '127.0.0.1',
'port': 6379
}
)
#db.py
from .caching import region
@region.cache_on_arguments()
def fetch_from_db(item):
return some_database.lookup(item)
How do I swap out the caching or disable it for unittests?