This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] [issue1026] When running with MySQL, do not test times with microsecond precision

Asheesh Laroia bugs at openhatch.org
Mon Aug 4 02:00:10 UTC 2014


New submission from Asheesh Laroia <asheesh at asheesh.org>:

Right now, it seems, when we run the tests with MySQL, we find test data 
mismatches due to (what seems to be) microsecond precision on times.

You can see this at https://travis-ci.org/openhatch/oh-mainline/jobs/31520619  -
- search for:

FAIL: test_set_mission_completed_records_first_completed_time 
(mysite.missions.tests.MissionCompletionTestCase)

and you'll find:

Traceback (most recent call last):
  File "/home/travis/build/openhatch/oh-mainline/mysite/missions/tests.py", line 
77, in test_set_mission_completed_records_first_completed_time
    self.assertGreater(obj_after.created_date, now)
AssertionError: datetime.datetime(2014, 8, 2, 19, 26, 33) not greater than 
datetime.datetime(2014, 8, 2, 19, 26, 33, 619950)


We don't care about the 619950 value, which seems to be a microseconds time 
value.

We also might want to change this test to use a mocked-out datetime.datetime, 
but that doesn't seem super necessary.

----------
messages: 4512
nosy: paulproteus
priority: bug
status: unread
title: When running with MySQL, do not test times with microsecond precision

__________________________________________
Roundup issue tracker <bugs at openhatch.org>
<https://openhatch.org/bugs/issue1026>
__________________________________________


More information about the Devel mailing list