Skip to content

Commit

Permalink
test(monitor): Do not perform equality checks with floating point val…
Browse files Browse the repository at this point in the history
…ues.
  • Loading branch information
jacksonpradolima committed Dec 22, 2024
1 parent 1d539c5 commit 647c27d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coleman4hcs/tests/utils/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def test_collect_single_record(monitor_collector, mock_scenario_provider, mock_m
assert record['scenario'] == "TestScenario"
assert record['experiment'] == 1
assert record['policy'] == "TestPolicy"
assert record['fitness'] == 0.8
assert record['cost'] == 0.6
# Use pytest.approx for floating-point comparisons
assert record['fitness'] == pytest.approx(0.8, rel=1e-6)
assert record['cost'] == pytest.approx(0.6, rel=1e-6)


def test_collect_from_temp(monitor_collector, mock_scenario_provider, mock_metric):
Expand Down

0 comments on commit 647c27d

Please sign in to comment.