Session fixture. Локальный кеш @pytest.yield_fixture(scope='session', autouse=True) def local_cache(): old_settings = settings.CACHES settings.CACHES = {'default': {…}} yield settings.CACHES = old_settings
{}