diff options
author | Guido van Rossum <guido@python.org> | 2008-01-01 04:15:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-01-01 04:15:29 (GMT) |
commit | 96b3249670ffa02c8794d881acb9e6d1bd670515 (patch) | |
tree | a8d15c2c0b0b7fa5389597c9fb9ee2b9c3774adb /Lib/sqlite3/test | |
parent | 59a65facf2f12c34c3e37b6aa5db8df6c0ec4329 (diff) | |
download | cpython-96b3249670ffa02c8794d881acb9e6d1bd670515.zip cpython-96b3249670ffa02c8794d881acb9e6d1bd670515.tar.gz cpython-96b3249670ffa02c8794d881acb9e6d1bd670515.tar.bz2 |
Fix an odd error which would only occur close to new year's eve, due
to use of datetime.datetime.now() instead of utcnow() for comparison.
(I think the test can still fail if it's executed pretty much *at*
new year's eve, but that's not worth fixing.)
Diffstat (limited to 'Lib/sqlite3/test')
-rw-r--r-- | Lib/sqlite3/test/types.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py index 506283d..3cc9aff 100644 --- a/Lib/sqlite3/test/types.py +++ b/Lib/sqlite3/test/types.py @@ -331,8 +331,7 @@ class DateTimeTests(unittest.TestCase): if sqlite.sqlite_version_info < (3, 1): return - # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time. - now = datetime.datetime.now() + now = datetime.datetime.utcnow() self.cur.execute("insert into test(ts) values (current_timestamp)") self.cur.execute("select ts from test") ts = self.cur.fetchone()[0] |