From 7653b84239ae903fc7677112036eb1fe881179f2 Mon Sep 17 00:00:00 2001 From: wendycwong Date: Tue, 30 Jul 2024 15:03:19 -0700 Subject: [PATCH] changed the error message caught in the tests. --- h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java | 4 ++-- .../testdir_algos/glm/pyunit_GH_6722_redundant_constraints.py | 2 +- .../testdir_algos/glm/runit_GH_6722_redundant_constraints.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java b/h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java index b0c13ca1d2bb..495fc1c11439 100644 --- a/h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java +++ b/h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java @@ -614,7 +614,7 @@ public void testDuplicateLinearConstraints() { Scope.track_generic(glm2); assert 1==2 : "Should have thrown an error due to duplicated constraints."; } catch(IllegalArgumentException ex) { - assert ex.getMessage().contains("redundant and possibly conflicting linear constraints") : "Wrong error message. Error should be about" + + assert ex.getMessage().contains("redundant linear constraints:") : "Wrong error message. Error should be about" + " redundant linear constraints"; } finally { Scope.exit(); @@ -642,7 +642,7 @@ public void testDuplicateBetaLinearConstraints() { Scope.track_generic(glm2); assert 1==2 : "Should have thrown an error due to duplicated constraints."; } catch(IllegalArgumentException ex) { - assert ex.getMessage().contains("redundant and possibly conflicting linear constraints") : "Wrong error message. Error should be about" + + assert ex.getMessage().contains("rredundant linear constraints:") : "Wrong error message. Error should be about" + " redundant linear constraints"; } finally { Scope.exit(); diff --git a/h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_redundant_constraints.py b/h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_redundant_constraints.py index 56a9c052625b..81fd336e2603 100644 --- a/h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_redundant_constraints.py +++ b/h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_redundant_constraints.py @@ -198,7 +198,7 @@ def test_redundant_constraints(): except Exception as ex: print(ex) temp = str(ex) - assert ("redundant and possibly conflicting linear constraints" in temp), "Wrong exception was received." + assert ("redundant linear constraints:" in temp), "Wrong exception was received." print("redundant constraint test passed!") if __name__ == "__main__": diff --git a/h2o-r/tests/testdir_algos/glm/runit_GH_6722_redundant_constraints.R b/h2o-r/tests/testdir_algos/glm/runit_GH_6722_redundant_constraints.R index d41fd01ded8c..59d0ca896cbe 100644 --- a/h2o-r/tests/testdir_algos/glm/runit_GH_6722_redundant_constraints.R +++ b/h2o-r/tests/testdir_algos/glm/runit_GH_6722_redundant_constraints.R @@ -24,7 +24,7 @@ test_constraints_redundant <- function() { }, error = function(e) { print("***") print(e) - expect_true(grepl("redundant and possibly conflicting linear constraints:", e)) + expect_true(grepl("redundant linear constraints:", e)) }) }