summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2023-03-15 22:24:33 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2023-03-15 22:24:33 +0000
commit918963553a93e107fc4c9d476ec1cb28d4500236 (patch)
treeed777d0720db3a6c74b2b0051dee908b9a599451 /test
parente8baf5aa010ce7e3dea9b0ccf5e8b0b90f4310ad (diff)
parente8420e993764b5dcd4ce5879412d556d2a7d2870 (diff)
downloadsqlalchemy-918963553a93e107fc4c9d476ec1cb28d4500236.tar.gz
Merge "use utc for datetimetz multirange tests" into main
Diffstat (limited to 'test')
-rw-r--r--test/dialect/postgresql/test_types.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index 61d2a3107..1ff9d785f 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -5177,24 +5177,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)