[New-bugs-announce] [issue29123] CheckSqlTimestamp is fragile

Berker Peksag report at bugs.python.org
Sat Dec 31 12:41:47 EST 2016


New submission from Berker Peksag:

======================================================================
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.

----------
components: Tests
messages: 284404
nosy: berker.peksag
priority: normal
severity: normal
stage: needs patch
status: open
title: CheckSqlTimestamp is fragile
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29123>
_______________________________________


More information about the New-bugs-announce mailing list