From 58090d3d3fae7752898300910bfef43a2c96615e Mon Sep 17 00:00:00 2001 From: Elizabeth Santorella Date: Wed, 8 Feb 2023 09:28:06 -0800 Subject: [PATCH] Fix codecov by raising UnsupportedError (#1662) Summary: Pull Request resolved: https://github.com/pytorch/botorch/pull/1662 Codecov is failing: https://app.codecov.io/gh/pytorch/botorch/commit/2f2b7e2163186e47da82b2da54b2fb0f001d9a7f Reviewed By: Balandat Differential Revision: D43120342 fbshipit-source-id: ea0c6ca035f6fcf116ecb1305d7367a9df55d48f --- test/optim/test_parameter_constraints.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/optim/test_parameter_constraints.py b/test/optim/test_parameter_constraints.py index c3601df295..748ee950cd 100644 --- a/test/optim/test_parameter_constraints.py +++ b/test/optim/test_parameter_constraints.py @@ -127,6 +127,14 @@ def test_make_linear_constraints(self): shapeX=torch.Size([1, 1, 2]), eq=False, ) + # test that len(shapeX) < 2 raises an error + with self.assertRaises(UnsupportedError): + _make_linear_constraints( + shapeX=torch.Size([2]), + indices=indices, + coefficients=coefficients, + rhs=0.0, + ) def test_make_scipy_linear_constraints(self): for shapeX in [torch.Size([2, 1, 4]), torch.Size([1, 4])]: