Salome HOME
Fix merge errors post 8.3.0
[tools/medcoupling.git] / src / ParaMEDMEM_Swig / test_InterpKernelDEC.py
index b98437e9dc587e6bba02a4f60975787bf924af43..056fd751f02102c9ae60a351dcfa3c823e914595 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -30,11 +30,11 @@ class ParaMEDMEMBasicsTest(unittest.TestCase):
         size = MPI_Comm_size(MPI_COMM_WORLD)
         rank = MPI_Comm_rank(MPI_COMM_WORLD)
         if size != 5:
-            raise RuntimeError, "Expect MPI_COMM_WORLD size == 5"
-        print rank
+            raise RuntimeError("Expect MPI_COMM_WORLD size == 5")
+        print(rank)
         nproc_source = 3
-        procs_source = range( nproc_source )
-        procs_target = range( size - nproc_source + 1, size)
+        procs_source = list(range(nproc_source))
+        procs_target = list(range(size - nproc_source + 1, size))
 
         interface = CommInterface()
         target_group = MPIProcessorGroup(interface, procs_target)
@@ -95,7 +95,7 @@ class ParaMEDMEMBasicsTest(unittest.TestCase):
             dec.sendData()
             dec.recvData()
             field_after_int=parafield.getVolumeIntegral(0,True);
-            self.failUnless(math.fabs(field_after_int-field_before_int)<1e-8)
+            self.assertTrue(math.fabs(field_after_int-field_before_int)<1e-8)
             pass
         else:
             dec.synchronize()