Skip to content

Commit 8734384

Browse files
committed
floats serialize to a different precision in py3
1 parent 0f2777b commit 8734384

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plotly/tests/test_optional/test_utils/test_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import numpy as np
1212
import json
1313
import pandas as pd
14+
import six
1415
from pandas.util.testing import assert_series_equal
1516
import matplotlib.pyplot as plt
1617

@@ -274,8 +275,11 @@ def test_masked_constants_example():
274275

275276
jy = json.dumps(renderer.plotly_fig['data'][1]['y'],
276277
cls=utils.PlotlyJSONEncoder)
277-
assert(jy == '[-398.11793026999999, -398.11792966000002, '
278-
'-398.11786308000001, null]')
278+
if six.PY3:
279+
assert(jy == '[-398.11793027, -398.11792966, -398.11786308, null]')
280+
else:
281+
assert(jy == '[-398.11793026999999, -398.11792966000002, '
282+
'-398.11786308000001, null]')
279283

280284

281285
def test_numpy_dates():

0 commit comments

Comments
 (0)