Skip to content

Commit 8a3ba12

Browse files
committed
Move np.negative test into unary ufunc tests
Relocate the np.negative assertion from the binary ufunc test block into the unary_ufunc test to group unary function checks together and eliminate the duplicate assertion. No functional changes—just test reorganization for clarity.
1 parent 554f534 commit 8a3ba12

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_expr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ def test_unary_ufunc(model):
276276
# forbid modifying Variable/Expr/GenExpr in-place via out parameter
277277
np.sin(x, out=np.array([0]))
278278

279+
# test np.negative
280+
assert str(np.negative(x)) == "Expr({Term(x): -1.0})"
281+
279282

280283
def test_binary_ufunc(model):
281284
m, x, y, z = model
@@ -306,9 +309,6 @@ def test_binary_ufunc(model):
306309
assert str(np.divide(x, a)) == "[Expr({Term(x): 0.5})]"
307310
assert str(np.divide(a, x)) == "[prod(2.0,**(sum(0.0,prod(1.0,x)),-1))]"
308311

309-
# test np.negative
310-
assert str(np.negative(x)) == "Expr({Term(x): -1.0})"
311-
312312
# test np.power
313313
assert str(np.power(x, 2)) == "Expr({Term(x, x): 1.0})"
314314
assert str(np.power(2, x)) == "exp(prod(1.0,sum(0.0,prod(1.0,x)),log(2.0)))"

0 commit comments

Comments
 (0)