Skip to content

Commit 640302c

Browse files
committed
updating some tests to reflect what we do for div
1 parent 9156e10 commit 640302c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cvxpy/tests/test_reductions.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def test_example_div(self):
7373
We consider the following expression:
7474
\frac{x + 2*y + z}{x + y}
7575
"""
76-
x = cp.Variable(name='x')
77-
y = cp.Variable(name='y')
78-
z = cp.Variable(name='z')
76+
x = cp.Variable((1,), name='x')
77+
y = cp.Variable((1,), name='y')
78+
z = cp.Variable((1,), name='z')
7979

8080
obj = (x + 2*y + z) / (x + y)
8181
problem = cp.Problem(cp.Minimize(obj), [])
@@ -88,11 +88,10 @@ def test_example_div(self):
8888
w2 = x + y
8989
w3 = w1/w2
9090
"""
91-
assert str(new_prob.objective) == "minimize var3"
92-
assert len(new_prob.constraints) == 3
93-
assert str(new_prob.constraints[0]) == "var1 == x + 2.0 @ y + z"
94-
assert str(new_prob.constraints[1]) == "var2 == x + y"
95-
assert str(new_prob.constraints[2]) == "var3 == var1 / var2"
91+
assert str(new_prob.objective) == "minimize var11"
92+
assert len(new_prob.constraints) == 2
93+
assert str(new_prob.constraints[0]) == "var11 @ var12 == x + 2.0 @ y + z"
94+
assert str(new_prob.constraints[1]) == "var12 == x + y"
9695

9796
def test_example_mul(self):
9897
"""

0 commit comments

Comments
 (0)