MCPcopy
hub / github.com/celery/celery / reset_cache_backend_state

Function reset_cache_backend_state

t/unit/conftest.py:96–104  ·  view source on GitHub ↗

Fixture that resets the internal state of the cache result backend.

(celery_app)

Source from the content-addressed store, hash-verified

94
95@pytest.fixture(autouse=True)
96def reset_cache_backend_state(celery_app):
97 """Fixture that resets the internal state of the cache result backend."""
98 yield
99 backend = celery_app.__dict__.get('backend')
100 if backend is not None:
101 if isinstance(backend, CacheBackend):
102 if isinstance(backend.client, DummyClient):
103 backend.client.cache.clear()
104 backend._cache.clear()
105
106
107@contextmanager

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected