test(metrics): compare metric floats with pytest.approx (SIENTIAPDE-2215)
This commit is contained in:
@@ -326,9 +326,9 @@ def test_compute_regression_metrics_ignores_nan_pairs():
|
||||
with patch.object(repo, 'warning') as warn:
|
||||
out = repo.compute_regression_metrics(tmr, wrapper)
|
||||
|
||||
assert out.mse_val == 0.0
|
||||
assert out.mae_val == 0.0
|
||||
assert out.r2_val == 1.0
|
||||
assert out.mse_val == pytest.approx(0.0)
|
||||
assert out.mae_val == pytest.approx(0.0)
|
||||
assert out.r2_val == pytest.approx(1.0)
|
||||
warn.assert_called_once()
|
||||
assert 'Ignoring 2 of 4' in warn.call_args.args[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user