summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_polynomial.py
diff options
context:
space:
mode:
authorjakobjakobson13 <43045863+jakobjakobson13@users.noreply.github.com>2020-08-18 06:29:02 +0200
committerGitHub <noreply@github.com>2020-08-17 21:29:02 -0700
commit0dc55882a976630d832ebebdb58350d9c26205fe (patch)
tree6cc0b98e946dee3725de77022de73784d5039386 /numpy/lib/tests/test_polynomial.py
parent67c7066353534eeac8054f0deb75dc5923c6dc20 (diff)
downloadnumpy-0dc55882a976630d832ebebdb58350d9c26205fe.tar.gz
BUG: fix typo in polydiv that prevented promotion to poly1d (#17053)
Fix bug caused by typo and added tests
Diffstat (limited to 'numpy/lib/tests/test_polynomial.py')
-rw-r--r--numpy/lib/tests/test_polynomial.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
index cd0b90dc4..ab6691b43 100644
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -243,6 +243,15 @@ class TestPolynomial:
assert_equal(q.coeffs.dtype, np.complex128)
assert_equal(r.coeffs.dtype, np.complex128)
assert_equal(q*a + r, b)
+
+ c = [1, 2, 3]
+ d = np.poly1d([1, 2, 3])
+ s, t = np.polydiv(c, d)
+ assert isinstance(s, np.poly1d)
+ assert isinstance(t, np.poly1d)
+ u, v = np.polydiv(d, c)
+ assert isinstance(u, np.poly1d)
+ assert isinstance(v, np.poly1d)
def test_poly_coeffs_mutable(self):
""" Coefficients should be modifiable """