From 71b763b054ca29dac9b3f711e5c44aa9c5dbbbb9 Mon Sep 17 00:00:00 2001 From: Kieran O'Mahony Date: Sat, 17 Aug 2013 21:24:39 +1000 Subject: [PATCH] TST: fix ujson's intermittently failing date unit test --- pandas/io/tests/test_json/test_ujson.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pandas/io/tests/test_json/test_ujson.py b/pandas/io/tests/test_json/test_ujson.py index 3b9c89e098740..4d6218d3dbc35 100644 --- a/pandas/io/tests/test_json/test_ujson.py +++ b/pandas/io/tests/test_json/test_ujson.py @@ -356,20 +356,19 @@ def test_npy_nat(self): assert ujson.encode(input) == 'null', "Expected null" def test_datetime_units(self): - raise nose.SkipTest("skipping for now, test is buggy, pls fix me") from pandas.lib import Timestamp - val = datetime.datetime.now() + val = datetime.datetime(2013, 8, 17, 21, 17, 12, 215504) stamp = Timestamp(val) roundtrip = ujson.decode(ujson.encode(val, date_unit='s')) - self.assert_(roundtrip == stamp.value // 1e9) + self.assert_(roundtrip == stamp.value // 10**9) roundtrip = ujson.decode(ujson.encode(val, date_unit='ms')) - self.assert_(roundtrip == stamp.value // 1e6) + self.assert_(roundtrip == stamp.value // 10**6) roundtrip = ujson.decode(ujson.encode(val, date_unit='us')) - self.assert_(roundtrip == stamp.value / 1e3) + self.assert_(roundtrip == stamp.value // 10**3) roundtrip = ujson.decode(ujson.encode(val, date_unit='ns')) self.assert_(roundtrip == stamp.value)