Skip to content

Commit 0cd87d5

Browse files
committed
fix test timeout
1 parent 62bffe3 commit 0cd87d5

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
from typing import Callable
2+
13
from pytest import raises
24

35
from firebolt.async_db import Connection
46
from firebolt.utils.exception import QueryTimeoutError
7+
from tests.integration.dbapi.conftest import LONG_SELECT_DEFAULT_V2
58

69
# Cannot have absolute path here since interpreter treats word async as keyword and not as a package name
710
from .test_queries_async import LONG_SELECT
811

912

10-
async def test_query_timeout(connection: Connection):
13+
async def test_query_timeout(
14+
connection: Connection, long_test_value: Callable[[int], int]
15+
) -> None:
1116
async with connection.cursor() as cursor:
1217
with raises(QueryTimeoutError):
13-
await cursor.execute(LONG_SELECT, timeout_seconds=1)
18+
await cursor.execute(
19+
LONG_SELECT.format(long_value=long_test_value(LONG_SELECT_DEFAULT_V2)),
20+
timeout_seconds=1,
21+
)
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1+
from typing import Callable
2+
13
from pytest import raises
24

35
from firebolt.db import Connection
46
from firebolt.utils.exception import QueryTimeoutError
7+
from tests.integration.dbapi.conftest import LONG_SELECT_DEFAULT_V2
58

69
from .test_queries import LONG_SELECT
710

811

9-
def test_query_timeout(connection: Connection):
12+
def test_query_timeout(
13+
connection: Connection, long_test_value: Callable[[int], int]
14+
) -> None:
1015
with connection.cursor() as cursor:
1116
with raises(QueryTimeoutError):
12-
cursor.execute(LONG_SELECT, timeout_seconds=1)
17+
cursor.execute(
18+
LONG_SELECT.format(long_value=long_test_value(LONG_SELECT_DEFAULT_V2)),
19+
timeout_seconds=1,
20+
)

0 commit comments

Comments
 (0)