提交 ae2a43ca authored 作者: Tanjay94's avatar Tanjay94

Fixed norm test to raise SkipTest only for old version of numpy.

上级 2f1a193b
...@@ -667,13 +667,15 @@ class T_NormTests(unittest.TestCase): ...@@ -667,13 +667,15 @@ class T_NormTests(unittest.TestCase):
[a, a, a, a, a, a, b, b, b, b, b, b, b, b], [a, a, a, a, a, a, b, b, b, b, b, b, b, b],
[None, 'fro', inf, -inf, 1, -1, None, inf, -inf, 0, 1, -1, 2, -2]) [None, 'fro', inf, -inf, 1, -1, None, inf, -inf, 0, 1, -1, 2, -2])
try:
numpy.linalg.norm([[2, 1], [3, 4]], None, None)
except "norm() takes at most 2 arguments (3 given)":
raise SkipTest
for i in range(0, 14): for i in range(0, 14):
f.append(function([A[1][i]], [norm(A[1][i], A[0][i], A[2][i])])) f.append(function([A[1][i]], [norm(A[1][i], A[0][i], A[2][i])]))
t_n.append(f[i](A[3][i])) t_n.append(f[i](A[3][i]))
try: n_n.append(numpy.linalg.norm(A[3][i], A[4][i], A[2][i]))
n_n.append(numpy.linalg.norm(A[3][i], A[4][i], A[2][i]))
except TypeError:
raise SkipTest
assert _allclose(n_n[i], t_n[i]) assert _allclose(n_n[i], t_n[i])
class T_lstsq(unittest.TestCase): class T_lstsq(unittest.TestCase):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论