diff --git a/cvxpy/tests/test_attributes.py b/cvxpy/tests/test_attributes.py index e87c2bc737..a2a94eb632 100644 --- a/cvxpy/tests/test_attributes.py +++ b/cvxpy/tests/test_attributes.py @@ -243,5 +243,12 @@ def test_integer_bounds(self) -> None: assert type(new_prob.apply(prob)[0].constraints[1]) is Inequality assert type(new_prob.apply(prob)[0].constraints[2]) is Equality + prob.solve() + assert np.allclose(x.value, target) + + def test_nonpos_nonneg_variable(self) -> None: + x = cp.Variable(shape=(2,2), nonpos=True, nonneg=True) + target = np.zeros((2,2)) + prob = cp.Problem(cp.Minimize(cp.sum(x)), [x >= -5]) prob.solve() assert np.allclose(x.value, target) \ No newline at end of file