Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckSqlTimestamp is fragile #73309

Closed
berkerpeksag opened this issue Dec 31, 2016 · 3 comments
Closed

CheckSqlTimestamp is fragile #73309

berkerpeksag opened this issue Dec 31, 2016 · 3 comments
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@berkerpeksag
Copy link
Member

BPO 29123
Nosy @berkerpeksag

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-12-31.19:48:10.121>
created_at = <Date 2016-12-31.17:41:47.676>
labels = ['3.7', 'type-bug', 'tests']
title = 'CheckSqlTimestamp is fragile'
updated_at = <Date 2016-12-31.23:49:26.279>
user = 'https://github.com/berkerpeksag'

bugs.python.org fields:

activity = <Date 2016-12-31.23:49:26.279>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2016-12-31.19:48:10.121>
closer = 'berker.peksag'
components = ['Tests']
creation = <Date 2016-12-31.17:41:47.676>
creator = 'berker.peksag'
dependencies = []
files = []
hgrepos = []
issue_num = 29123
keywords = []
message_count = 3.0
messages = ['284404', '284413', '284416']
nosy_count = 2.0
nosy_names = ['python-dev', 'berker.peksag']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue29123'
versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

@berkerpeksag
Copy link
Member Author

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

@berkerpeksag berkerpeksag added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Dec 31, 2016
@python-dev
Copy link
Mannequin

python-dev mannequin commented Dec 31, 2016

New changeset bb64ae455490 by Berker Peksag in branch '3.5':
Issue bpo-29123: Make CheckSqlTimestamp more robust
https://hg.python.org/cpython/rev/bb64ae455490

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

New changeset ad06f9acff92 by Berker Peksag in branch 'default':
Issue bpo-29123: Merge from 3.6
https://hg.python.org/cpython/rev/ad06f9acff92

@python-dev
Copy link
Mannequin

python-dev mannequin commented Dec 31, 2016

New changeset 1d5b4426fe87 by Berker Peksag in branch '2.7':
Issue bpo-29123: Make CheckSqlTimestamp more robust
https://hg.python.org/cpython/rev/1d5b4426fe87

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant