async def state_manager(request) -> AsyncGenerator[StateManager, None]:
    """Instance of state manager parametrized for redis and in-process.

    Args:
        request: pytest request object.

    Yields:
        A state manager instance
    """
    state_manager = StateManager.create(state=TestState)
    if request.param == "redis":
        if not isinstance(state_manager, StateManagerRedis):
            pytest.skip("Test requires redis")
    elif request.param == "disk":
        # explicitly NOT using redis
        state_manager = StateManagerDisk(state=TestState)
        assert not state_manager._states_locks
    else:
        state_manager = StateManagerMemory(state=TestState)
        assert not state_manager._states_locks

    yield state_manager

    if isinstance(state_manager, StateManagerRedis):
        await state_manager.close()
Instance of state manager parametrized for redis and in-process.

    Args:
        request: pytest request object.

    Yields:
        A state manager instance
    
tests/units/test_state.py