Ejemplo n.º 1
0
async def test_params_precedence():
    async with create_pool('clickhouse://***:***@host/db',
                           user='******',
                           password='******') as pool:
        assert pool._client.params == {
            'database': 'db',
            'user': '******',
            'password': '******',
        }
Ejemplo n.º 2
0
async def test_session_timeout(dsn):
    async with create_pool(dsn, session_timeout=0.1) as conn:
        with pytest.raises(asyncio.TimeoutError):
            await conn.execute(LONG_QUERY)
Ejemplo n.º 3
0
async def test_pool_dsn_params(dsn):
    dsn += '?max_execution_time=1'
    async with create_pool(dsn) as conn:
        with pytest.raises(DBException) as exc_info:
            await conn.execute(LONG_QUERY)
    assert exc_info.value.code == error_codes.TIMEOUT_EXCEEDED