Skip to content

Commit 051669f

Browse files
john-bodleyhashhar
authored andcommitted
Parameterize time and timestamp with time zone tests
1 parent 743f24a commit 051669f

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

tests/integration/test_types_integration.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,15 @@ def test_time(trino_connection):
284284

285285

286286
@pytest.mark.skipif(trino_version() == '351', reason="time not rounded correctly in older Trino versions")
287-
def test_time_with_timezone(trino_connection):
288-
query_time_with_timezone(trino_connection, '-08:00')
289-
query_time_with_timezone(trino_connection, '+08:00')
290-
query_time_with_timezone(trino_connection, '+05:30')
291-
292-
293-
def query_time_with_timezone(trino_connection, tz_str: str):
287+
@pytest.mark.parametrize(
288+
'tz_str',
289+
[
290+
'-08:00',
291+
'+08:00',
292+
'+05:30',
293+
]
294+
)
295+
def test_time_with_timezone(trino_connection, tz_str: str):
294296
tz = create_timezone(tz_str)
295297
(
296298
SqlTest(trino_connection)
@@ -550,16 +552,17 @@ def test_timestamp(trino_connection):
550552
).execute()
551553

552554

553-
def test_timestamp_with_timezone(trino_connection):
554-
query_timestamp_with_timezone(trino_connection, '-08:00')
555-
query_timestamp_with_timezone(trino_connection, '+08:00')
556-
query_timestamp_with_timezone(trino_connection, '+05:30')
557-
query_timestamp_with_timezone(trino_connection, 'US/Eastern')
558-
query_timestamp_with_timezone(trino_connection, 'Asia/Kolkata')
559-
query_timestamp_with_timezone(trino_connection, 'GMT')
560-
561-
562-
def query_timestamp_with_timezone(trino_connection, tz_str):
555+
@pytest.mark.parametrize(
556+
'tz_str',
557+
[
558+
'-08:00',
559+
'+08:00',
560+
'US/Eastern',
561+
'Asia/Kolkata',
562+
'GMT',
563+
]
564+
)
565+
def test_timestamp_with_timezone(trino_connection, tz_str):
563566
tz = create_timezone(tz_str)
564567
(
565568
SqlTest(trino_connection)

0 commit comments

Comments
 (0)