diff --git a/unittest/python/test_user_type.py b/unittest/python/test_user_type.py
index bcdf78e121b3c6e4e7560c144129e8c417e4df8b..7b7d3a1d0fb2ab6f0acbf3c04a266ca9721ff4e3 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')