From 0211ccfb5df171b1a541b95c0519fcb44f3bea08 Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Mon, 26 Jul 2021 12:02:55 +0200
Subject: [PATCH] test: only made some check for new version of NumPy

---
 unittest/python/test_user_type.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/unittest/python/test_user_type.py b/unittest/python/test_user_type.py
index bcdf78e..7b7d3a1 100644
--- a/unittest/python/test_user_type.py
+++ b/unittest/python/test_user_type.py
@@ -1,5 +1,6 @@
 import user_type
 import numpy as np
+from packaging import version
 
 rows = 10
 cols = 20
@@ -10,10 +11,11 @@ def test(mat):
   assert (mat == mat_copy).all()
   assert not (mat != mat_copy).all()
 
-  mat.fill(mat.dtype.type(20.))
-  mat_copy = mat.copy()
-  assert((mat == mat_copy).all())
-  assert(not (mat != mat_copy).all())
+  if version.parse(np.__version__) >= version.parse("1.21.0"): # check if it fixes for new versio of NumPy 
+    mat.fill(mat.dtype.type(20.))
+    mat_copy = mat.copy()
+    assert((mat == mat_copy).all())
+    assert(not (mat != mat_copy).all())
 
   mat_op = mat + mat
   mat_op = mat.copy(order='F') + mat.copy(order='C')
-- 
GitLab