diff --git a/tests/testflows/datetime64_extended_range/regression.py b/tests/testflows/datetime64_extended_range/regression.py index 2480f59383c..7a849f3a0c6 100755 --- a/tests/testflows/datetime64_extended_range/regression.py +++ b/tests/testflows/datetime64_extended_range/regression.py @@ -20,6 +20,7 @@ from datetime64_extended_range.common import * # https://github.com/ClickHouse/ClickHouse/issues/22928 : toStartOf...() wrong when out of normal range # https://github.com/ClickHouse/ClickHouse/issues/22929 : toUnixTimestamp() exception when out of normal # https://github.com/ClickHouse/ClickHouse/issues/22930 : toWeek() +# https://github.com/ClickHouse/ClickHouse/issues/22948 : toYearWeek() xfails = { "type conversion/to int 8 16 32 64 128 256/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/16581#issuecomment-804360350")], @@ -34,6 +35,7 @@ xfails = { "date time funcs/to start of :/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22928")], "date time funcs/to unix timestamp/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22929")], "date time funcs/to week/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22930")], + "date time funcs/to year week/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22948")], } diff --git a/tests/testflows/datetime64_extended_range/tests/date_time_functions.py b/tests/testflows/datetime64_extended_range/tests/date_time_functions.py index 243434b3052..aa9c678593a 100644 --- a/tests/testflows/datetime64_extended_range/tests/date_time_functions.py +++ b/tests/testflows/datetime64_extended_range/tests/date_time_functions.py @@ -119,11 +119,13 @@ def to_day_of(self, py_func, ch_func): with When("I check each of the datetimes"): for dt in datetimes: for tz1, tz2 in itertools.product(timezones, timezones): - with Example(f"{dt} {tz1} -> {tz2}"): + with When(f"{dt} {tz1} -> {tz2}"): with By("Computing expected result using pytz"): time_tz1 = pytz.timezone(tz1).localize(dt) time_tz2 = time_tz1.astimezone(pytz.timezone(tz2)) result = eval(f"time_tz2.timetuple().{py_func}") + if py_func == "tm_wday": + result += 1 expected = f"{result}" with And(f"Forming a {ch_func} ClickHouse query"): dt_str = dt.strftime("%Y-%m-%d %H:%M:%S")