MCPcopy
hub / github.com/Flagsmith/flagsmith / reset_cache

Function reset_cache

api/tests/conftest.py:671–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

669
670@pytest.fixture()
671def reset_cache(): # type: ignore[no-untyped-def]
672 # https://groups.google.com/g/django-developers/c/zlaPsP13dUY
673 # TL;DR: Use this if your test interacts with cache since django
674 # does not clear cache after every test
675 # Clear all caches before the test
676 for cache in caches.all():
677 cache.clear()
678
679 yield
680
681 # Clear all caches after the test
682 for cache in caches.all():
683 cache.clear()
684
685
686@pytest.fixture()

Callers

nothing calls this directly

Calls 1

allMethod · 0.45

Tested by

no test coverage detected