Skip to content

Commit f99bf21

Browse files
[Async] Apply #2227 to async code
1 parent 1f47e63 commit f99bf21

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/integ/aio/test_cursor_async.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,23 @@ async def test_out_of_range_year(conn_cnx, result_format, cursor_type, fetch_met
17491749
await fetch_next_fn()
17501750

17511751

1752+
@pytest.mark.parametrize("result_format", ("json", "arrow"))
1753+
async def test_out_of_range_year_followed_by_correct_year(conn_cnx, result_format):
1754+
"""Tests whether the year 10000 is out of range exception is raised as expected."""
1755+
async with conn_cnx(
1756+
session_parameters={
1757+
PARAMETER_PYTHON_CONNECTOR_QUERY_RESULT_FORMAT: result_format
1758+
}
1759+
) as con:
1760+
async with con.cursor() as cur:
1761+
await cur.execute("select TO_DATE('10000-01-01'), TO_DATE('9999-01-01')")
1762+
with pytest.raises(
1763+
InterfaceError,
1764+
match="out of range",
1765+
):
1766+
await cur.fetchall()
1767+
1768+
17521769
async def test_describe(conn_cnx):
17531770
async with conn_cnx() as con:
17541771
async with con.cursor() as cur:

0 commit comments

Comments
 (0)