diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-14 09:16:25 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-14 11:37:30 -0400 |
| commit | e8420e993764b5dcd4ce5879412d556d2a7d2870 (patch) | |
| tree | ac9c06b0c13aaf6f7d1b0ebe23e835f074f80388 /test/dialect/postgresql | |
| parent | 9f1b6ae053f5513bbf0ce221ed9ab4fb9d8e0ca7 (diff) | |
| download | sqlalchemy-e8420e993764b5dcd4ce5879412d556d2a7d2870.tar.gz | |
use utc for datetimetz multirange tests
these tests failed the day before DST here, so just use utc
Fixes: #9471
Change-Id: I3f5c940b4e7d36943bd3ad34cc06b9563371d171
Diffstat (limited to 'test/dialect/postgresql')
| -rw-r--r-- | test/dialect/postgresql/test_types.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index 2b15c7d73..c960b9e2f 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -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) |
