Skip to content

Commit fb5876f

Browse files
authored
tests: assert bounds within reasonable machine precision (#1432)
1 parent 04d8a6d commit fb5876f

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

tests/plugins/test_heat_map.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ def test_heat_map():
4848
assert tmpl.render(this=hm)
4949

5050
bounds = m.get_bounds()
51-
assert bounds == [[46.218566840847025, 3.0302801394447734],
52-
[50.75345011431167, 7.132453997672826]], bounds
51+
np.testing.assert_allclose(
52+
bounds,
53+
[[46.218566840847025, 3.0302801394447734],
54+
[50.75345011431167, 7.132453997672826]])
5355

5456

5557
def test_heatmap_data():

tests/plugins/test_marker_cluster.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@ def test_marker_cluster():
5353
assert expected in out
5454

5555
bounds = m.get_bounds()
56-
assert bounds == [[35.147332572663785, -11.520684337300109],
57-
[59.839718052359274, 29.94931046497927]], bounds
56+
np.testing.assert_allclose(
57+
bounds,
58+
[[35.147332572663785, -11.520684337300109],
59+
[59.839718052359274, 29.94931046497927]])

tests/test_folium.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,6 @@ def test_json_request(self):
364364

365365
self.m._parent.render()
366366
bounds = self.m.get_bounds()
367-
assert bounds == [[18.948267, -178.123152], [71.351633, 173.304726]], bounds # noqa
367+
np.testing.assert_allclose(
368+
bounds,
369+
[[18.948267, -178.123152], [71.351633, 173.304726]])

0 commit comments

Comments
 (0)