MCPcopy
hub / github.com/reflex-dev/reflex / state_manager_redis

Function state_manager_redis

tests/units/test_state_tree.py:218–237  ·  view source on GitHub ↗

Instance of state manager for redis only. Args: app_module_mock: The app module mock fixture. Yields: A state manager instance

(
    app_module_mock,
)

Source from the content-addressed store, hash-verified

216
217@pytest_asyncio.fixture(loop_scope="function", scope="function")
218async def state_manager_redis(
219 app_module_mock,
220) -> AsyncGenerator[StateManager, None]:
221 """Instance of state manager for redis only.
222
223 Args:
224 app_module_mock: The app module mock fixture.
225
226 Yields:
227 A state manager instance
228 """
229 app_module_mock.app = rx.App(_state=Root)
230 state_manager = app_module_mock.app.state_manager
231
232 if not isinstance(state_manager, StateManagerRedis):
233 pytest.skip("Test requires redis")
234
235 yield state_manager
236
237 await state_manager.close()
238
239
240@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected