@pytest.fixture(autouse=True)
def reset_cache_backend_state(celery_app):
 (yield)
 backend = celery_app.__dict__.get(u'backend')
 if (backend is not None):
  if isinstance(backend, CacheBackend):
   if isinstance(backend.client, DummyClient):
    backend.client.cache.clear()
   backend._cache.clear()

@ pytest . fixture ( autouse = True ) def reset_cache_backend_state ( celery_app ) : ( yield ) backend = celery_app . __dict__ . get ( u'backend' ) if ( backend is not None ) : if isinstance ( backend , CacheBackend ) : if isinstance ( backend . client , DummyClient ) : backend . client . cache . clear ( ) backend . _cache . clear ( )
fixture that resets the internal state of the cache result backend .