Exemple #1
0
async def test_no_connection_to_release():
    match = r'^no connection of norel to release$'
    with pytest.raises(RedisConnectorError, match=match):
        RedisConnector.instance('norel').release()
Exemple #2
0
async def redis():
    from tornado_battery.redis import connect_redis
    redis = RedisConnector.instance('test')
    connect = connect_redis('test')
    await connect()
    return redis
async def test_no_connection():
    match = r"^no connection of noconn found$"
    with pytest.raises(RedisConnectorError, match=match):
        RedisConnector.instance("noconn").connection()
Exemple #4
0
async def redis():
    redis = RedisConnector.instance('locks')
    await redis.connect()
    yield redis
async def redis():
    redis = RedisConnector.instance("test")
    await redis.connect()
    return redis