Skip to content

Commit

Permalink
Fix codecov by raising UnsupportedError (pytorch#1662)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1662

Codecov is failing: https://app.codecov.io/gh/pytorch/botorch/commit/2f2b7e2163186e47da82b2da54b2fb0f001d9a7f

Reviewed By: Balandat

Differential Revision: D43120342

fbshipit-source-id: ea0c6ca035f6fcf116ecb1305d7367a9df55d48f
  • Loading branch information
esantorella authored and facebook-github-bot committed Feb 8, 2023
1 parent 2f2b7e2 commit 58090d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/optim/test_parameter_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])]:
Expand Down

0 comments on commit 58090d3

Please sign in to comment.