Skip to content

Commit fae9abd

Browse files
committed
Test DateType from timestamp rounding anomaly workaround
PYTHON-230
1 parent f7e014a commit fae9abd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/unit/test_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ def test_datetype(self):
294294

295295
self.assertRaises(ValueError, date_type.interpret_datestring, 'fakestring')
296296

297+
# work around rounding difference among Python versions (PYTHON-230)
298+
expected = 1424817268.274
299+
self.assertEqual(DateType.deserialize(int64_pack(int(1000 * expected)), 0), datetime.datetime(2015, 2, 24, 22, 34, 28, 274000))
300+
301+
297302
def test_write_read_string(self):
298303
with tempfile.TemporaryFile() as f:
299304
value = u'test'

0 commit comments

Comments
 (0)