]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
use utc for datetimetz multirange tests
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Mar 2023 13:16:25 +0000 (09:16 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Mar 2023 15:37:30 +0000 (11:37 -0400)
these tests failed the day before DST here, so just use utc

Fixes: #9471
Change-Id: I3f5c940b4e7d36943bd3ad34cc06b9563371d171

test/dialect/postgresql/test_types.py

index 2b15c7d735af2c9bffc3a5bc7c3cad701a800d64..c960b9e2f29b610d444126d8bdacba3772831b7d 100644 (file)
@@ -5176,24 +5176,36 @@ class _DateTimeTZMultiRangeTests:
     _col_type = TSTZMULTIRANGE
     _col_str = "TSTZMULTIRANGE"
 
+    __only_on__ = "postgresql"
+
     # make sure we use one, steady timestamp with timezone pair
     # for all parts of all these tests
     _tstzs = None
     _tstzs_delta = None
 
     def tstzs(self):
+        utc_now = cast(
+            func.current_timestamp().op("AT TIME ZONE")("utc"),
+            DateTime(timezone=True),
+        )
+
         if self._tstzs is None:
             with testing.db.connect() as connection:
-                lower = connection.scalar(func.current_timestamp().select())
+                lower = connection.scalar(select(utc_now))
                 upper = lower + datetime.timedelta(1)
                 self._tstzs = (lower, upper)
         return self._tstzs
 
     def tstzs_delta(self):
+        utc_now = cast(
+            func.current_timestamp().op("AT TIME ZONE")("utc"),
+            DateTime(timezone=True),
+        )
+
         if self._tstzs_delta is None:
             with testing.db.connect() as connection:
                 lower = connection.scalar(
-                    func.current_timestamp().select()
+                    select(utc_now)
                 ) + datetime.timedelta(3)
                 upper = lower + datetime.timedelta(2)
                 self._tstzs_delta = (lower, upper)