Skip to content

Commit 315e020

Browse files
committed
Refactored test file
1 parent 9666640 commit 315e020

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

integration_tests/symbolics_05.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ def test_operations():
55
x: S = Symbol('x')
66
y: S = Symbol('y')
77
z: S = Symbol('z')
8-
9-
# test expand
108
a: S = (x + y)**S(2)
119
b: S = (x + y + z)**S(3)
10+
11+
# test expand
1212
assert(a.expand() == S(2)*x*y + x**S(2) + y**S(2))
1313
assert(expand(b) == S(3)*x*y**S(2) + S(3)*x*z**S(2) + S(3)*x**S(2)*y + S(3)*x**S(2)*z +\
1414
S(3)*y*z**S(2) + S(3)*y**S(2)*z + S(6)*x*y*z + x**S(3) + y**S(3) + z**S(3))
1515
print(a.expand())
1616
print(expand(b))
1717

1818
# test diff
19-
c: S = (x + y)**S(2)
20-
d: S = (x + y + z)**S(3)
21-
assert(c.diff(x) == S(2)*(x + y))
22-
assert(diff(d, x) == S(3)*(x + y + z)**S(2))
23-
print(c.diff(x))
24-
print(diff(d, x))
19+
assert(a.diff(x) == S(2)*(x + y))
20+
assert(diff(b, x) == S(3)*(x + y + z)**S(2))
21+
print(a.diff(x))
22+
print(diff(b, x))
2523

2624
test_operations()

0 commit comments

Comments
 (0)