summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatteo Raso <matteo_luigi_raso@protonmail.com>2022-11-26 16:14:09 -0500
committerMatteo Raso <matteo_luigi_raso@protonmail.com>2022-11-26 16:14:09 -0500
commitab24072afa1beefd54e72377c500b61400e04a5c (patch)
treea49586b70ee0a9dc2a4f5fbd8effef11fbffa9b1 /numpy
parent3b9c49e5bb47a979fedb151e36f4e3a00724b096 (diff)
downloadnumpy-ab24072afa1beefd54e72377c500b61400e04a5c.tar.gz
Added pickle test for polynomials
Diffstat (limited to 'numpy')
-rw-r--r--numpy/polynomial/tests/test_polynomial.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
index 032bf0e76..6b3ef2388 100644
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -5,6 +5,7 @@ from functools import reduce
import numpy as np
import numpy.polynomial.polynomial as poly
+import pickle
from copy import deepcopy
from numpy.testing import (
assert_almost_equal, assert_raises, assert_equal, assert_,
@@ -47,6 +48,11 @@ class TestConstants:
y = deepcopy(x)
assert_equal(x, y)
+ def test_pickle(self):
+ x = poly.Polynomial([1, 2, 3])
+ y = pickle.loads(pickle.dumps(x))
+ assert_equal(x, y)
+
class TestArithmetic:
def test_polyadd(self):