From 3c4045f64b20107f00eee8132c08af6d90737252 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Mon, 5 Oct 2020 11:44:51 -0500 Subject: [PATCH] StaticLazy: Add tolerance to tests --- miplearn/components/tests/test_lazy_static.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/miplearn/components/tests/test_lazy_static.py b/miplearn/components/tests/test_lazy_static.py index da7bfb9..56a0014 100644 --- a/miplearn/components/tests/test_lazy_static.py +++ b/miplearn/components/tests/test_lazy_static.py @@ -41,7 +41,8 @@ def test_usage_with_solver(): }[cid]) component = StaticLazyConstraintsComponent(threshold=0.90, - use_two_phase_gap=False) + use_two_phase_gap=False, + violation_tolerance=1.0) component.classifiers = { "type-a": Mock(spec=Classifier), "type-b": Mock(spec=Classifier), @@ -105,7 +106,7 @@ def test_usage_with_solver(): # Should ask internal solver to verify if constraints in the pool are # satisfied and add the ones that are not - internal.is_constraint_satisfied.assert_called_once_with("") + internal.is_constraint_satisfied.assert_called_once_with("", tol=1.0) internal.is_constraint_satisfied.reset_mock() internal.add_constraint.assert_called_once_with("") internal.add_constraint.reset_mock()