Skip to content

Commit f1dc2fa

Browse files
committed
Fix matrix variable test assertions to use getVal
Updated assertions in test_matrix_variable.py to use m.getVal(x) and m.getVal(y) instead of direct variable comparison. This ensures the tests check the evaluated values from the model rather than the symbolic variables.
1 parent 7a1275d commit f1dc2fa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎tests/test_matrix_variable.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ def test_matrix_cons_compare_with_expr():
428428

429429
m.setObjective(x.sum() + y.sum())
430430

431-
assert (x == np.ones(3)).all()
432-
assert (y == np.ones(3)).all()
431+
assert (m.getVal(x) == np.ones(3)).all()
432+
assert (m.getVal(y) == np.ones(3)).all()
433433

434434

435435
def test_ranged_matrix_cons():
@@ -446,4 +446,4 @@ def test_ranged_matrix_cons():
446446

447447
m.setObjective(x.sum())
448448

449-
assert (x == np.ones(3)).all()
449+
assert (m.getVal(x) == np.ones(3)).all()

0 commit comments

Comments
 (0)