replace strict fp equality with allclose
import networkx as nx
import numpy as np
+from numpy.testing import assert_allclose
from bokeh.models.graphs import StaticLayoutProvider, from_networkx
@@ -20,7 +21,7 @@ def test_from_networkx_method():
gl = renderer.layout_provider.graph_layout
assert set(gl.keys()) == set([0,1,2,3])
- assert np.array_equal(gl[0], np.array([1., 0.]))
+ assert_allclose(gl[0], np.array([1., 0.]), atol=1e-7)
def test_from_networkx_method_with_kwargs():
G=nx.Graph()
@@ -31,4 +32,4 @@ def test_from_networkx_method_with_kwargs():
gl = renderer.layout_provider.graph_layout
assert set(gl.keys()) == set([0,1,2,3])
- assert np.array_equal(gl[0], np.array([2., 0.]))
+ assert_allclose(gl[0], np.array([2., 0.]), atol=1e-7)
