summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-10-20 22:20:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-10-20 22:20:06 -0400
commitac358a04a7b077602ac668c19c3c40389d9e77e4 (patch)
tree54f42477c2cf35d1e538eae4bc39e5bb230fd462
parent1963fdceae7e362f317df3621854c6276fa3fc2c (diff)
downloadsqlalchemy-ac358a04a7b077602ac668c19c3c40389d9e77e4.tar.gz
Use the same "current_timestamp" function for both sides of round trip
this test was using sysdate() and current_timestamp() together in conjunction with a truncation to DAY, however for four hours on saturday night (see commit time :) ) these two values will have a different value if one side is EDT and the other is UTC. tox does not transmit environment variables including TZ by default, so even if the server is set up for EDT, running tox will not set TZ and at least Oracle client seems to use this value, producing UTC for session time but the database on CI was configured for EDT, producing EDT for sysdate. Change-Id: I56602d2402a475a0c4fdf61c1c5fc2618c82f915
-rw-r--r--test/sql/test_defaults.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py
index 42514a927..c5efdf132 100644
--- a/test/sql/test_defaults.py
+++ b/test/sql/test_defaults.py
@@ -170,7 +170,8 @@ class DefaultTest(fixtures.TestBase):
sa.select(
[
func.trunc(
- func.sysdate(), sa.literal_column("'DAY'"),
+ func.current_timestamp(),
+ sa.literal_column("'DAY'"),
type_=sa.Date)]))
assert isinstance(ts, datetime.date) and not isinstance(
ts, datetime.datetime)
@@ -182,7 +183,8 @@ class DefaultTest(fixtures.TestBase):
type_=sa.Date)
def1 = currenttime
def2 = func.trunc(
- sa.text("sysdate"), sa.literal_column("'DAY'"), type_=sa.Date)
+ sa.text("current_timestamp"),
+ sa.literal_column("'DAY'"), type_=sa.Date)
deftype = sa.Date
elif use_function_defaults: