Skip to content

Commit f7f0293

Browse files
committed
more explicit testing of pickling of user defined symbol
1 parent 4f0775a commit f7f0293

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

symengine/tests/test_pickling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ def __reduce__(self):
3131
def test_pysymbol():
3232
a = MySymbol("hello", attr=1)
3333
b = pickle.loads(pickle.dumps(a + 2)) - 2
34+
c = MySymbol("hello", attr=-1)
3435
try:
3536
assert a == b
37+
assert type(a) == type(b)
38+
assert a.attr == 1
39+
assert b.attr == 1
40+
assert b != c
3641
finally:
3742
a._unsafe_reset()
3843
b._unsafe_reset()
44+
c._unsafe_reset()
3945

4046
a = MySymbolBase("hello", attr=1)
4147
try:

0 commit comments

Comments
 (0)