async def test_params_precedence(): async with create_pool('clickhouse://***:***@host/db', user='******', password='******') as pool: assert pool._client.params == { 'database': 'db', 'user': '******', 'password': '******', }
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)
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