Salome HOME
Merge branch 'V9_2_2_BR'
[modules/kernel.git] / src / KERNEL_PY / kernel / unittester.py
index 1a0001b98f0e1d6ce625109169aadf7e5aaad500..b2a18646c6b681f3ef5baafb31697b4859b5c03e 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: iso-8859-1 -*-
-# Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -45,12 +45,12 @@ def run(modulePath, functionName):
     module=sys.modules[moduleName]
     func = getattr(module,functionName)
     tabsize = 70-len(moduleName)-len(functionName)
-    print "[TEST] %s.%s %s test in progress" % (moduleName, functionName,"."*tabsize
+    print("[TEST] %s.%s %s test in progress" % (moduleName, functionName,"."*tabsize)
     ok = func()
     if ( ok ):
-        print "[TEST] %s.%s %s OK" % (moduleName, functionName,"."*tabsize)
+        print("[TEST] %s.%s %s OK" % (moduleName, functionName,"."*tabsize))
     else:
-        print "[TEST] %s.%s %s NOT OK" % (moduleName, functionName,"."*tabsize)
+        print("[TEST] %s.%s %s NOT OK" % (moduleName, functionName,"."*tabsize))
 
 ## This function is for debug only. It executes the specified function with the
 #  specified arguments in a try/except block so as to display the exception in
@@ -64,11 +64,11 @@ def tryfunction(function,*argv):
     the case where an exception is raised (useful to debug server side of a CORBA
     process).
     """
-    print "[TEST] trying the function %s" % function
+    print("[TEST] trying the function %s" % function)
     try:
         return function(*argv)
-    except Exception, e:
-        print e
+    except Exception as e:
+        print(e)
         raise e