Skip to content
Snippets Groups Projects
Verified Commit 0211ccfb authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: only made some check for new version of NumPy

parent bc905acc
No related branches found
No related tags found
No related merge requests found
import user_type import user_type
import numpy as np import numpy as np
from packaging import version
rows = 10 rows = 10
cols = 20 cols = 20
...@@ -10,10 +11,11 @@ def test(mat): ...@@ -10,10 +11,11 @@ def test(mat):
assert (mat == mat_copy).all() assert (mat == mat_copy).all()
assert not (mat != mat_copy).all() assert not (mat != mat_copy).all()
mat.fill(mat.dtype.type(20.)) if version.parse(np.__version__) >= version.parse("1.21.0"): # check if it fixes for new versio of NumPy
mat_copy = mat.copy() mat.fill(mat.dtype.type(20.))
assert((mat == mat_copy).all()) mat_copy = mat.copy()
assert(not (mat != mat_copy).all()) assert((mat == mat_copy).all())
assert(not (mat != mat_copy).all())
mat_op = mat + mat mat_op = mat + mat
mat_op = mat.copy(order='F') + mat.copy(order='C') mat_op = mat.copy(order='F') + mat.copy(order='C')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment