This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: CheckSqlTimestamp is fragile
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, python-dev
Priority: normal Keywords:

Created on 2016-12-31 17:41 by berker.peksag, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg284404 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-12-31 17:41
======================================================================
FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/buildarea/3.6.angelico-debian-amd64/build/Lib/sqlite3/test/types.py", line 391, in CheckSqlTimestamp
    self.assertEqual(ts.year, now.year)
AssertionError: 2016 != 2017

----------------------------------------------------------------------

See http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.6/builds/93/steps/test/logs/stdio for details.

In Lib/sqlite3/test/types.py, there is a comment saying

    # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time.

Unless I'm missing something, there is no reason not to use datetime.utcnow(). That would make the test more robust.
msg284413 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-31 19:47
New changeset bb64ae455490 by Berker Peksag in branch '3.5':
Issue #29123: Make CheckSqlTimestamp more robust
https://hg.python.org/cpython/rev/bb64ae455490

New changeset 0331420d6cba by Berker Peksag in branch '3.6':
Issue #29123: Merge from 3.5
https://hg.python.org/cpython/rev/0331420d6cba

New changeset ad06f9acff92 by Berker Peksag in branch 'default':
Issue #29123: Merge from 3.6
https://hg.python.org/cpython/rev/ad06f9acff92
msg284416 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-31 23:49
New changeset 1d5b4426fe87 by Berker Peksag in branch '2.7':
Issue #29123: Make CheckSqlTimestamp more robust
https://hg.python.org/cpython/rev/1d5b4426fe87
History
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73309
2016-12-31 23:49:26python-devsetmessages: + msg284416
2016-12-31 19:48:10berker.peksagsetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2016-12-31 19:47:39python-devsetnosy: + python-dev
messages: + msg284413
2016-12-31 17:41:47berker.peksagcreate