Skip to content

Commit 4fc892e

Browse files
committed
check only for near equality
1 parent f108db7 commit 4fc892e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,6 +4310,17 @@ def test_optional_arguments(self):
43104310

43114311

43124312
class TestHexbinMapbox(NumpyTestUtilsMixin, TestCaseNoTemplate):
4313+
def assert_dict_equal(self, dict1, dict2, decimal=7):
4314+
for k, v in dict1.items():
4315+
if isinstance(v, dict):
4316+
assert_dict_almost_equal(v, dict2[k], decimal=decimal)
4317+
elif isinstance(v, float):
4318+
np.testing.assert_almost_equal(v, dict2[k], decimal=decimal)
4319+
else:
4320+
assert (
4321+
v == dict2[k]
4322+
), f"Values for key {k} are not equal: {v} != {dict2[k]}"
4323+
43134324
def test_aggregation(self):
43144325

43154326
lat = [0, 1, 1, 2, 4, 5, 1, 2, 4, 5, 2, 3, 2, 1, 5, 3, 5]

0 commit comments

Comments
 (0)