X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fsalomeloader%2FtestSalomeLoader.py.in;h=8cb5b3d8a3b53768982986ea940e9c3cc9a2e5cb;hb=255150e4eec79294bbd06c7c464f309b4a264960;hp=339bf11bc83d27587ba856785b8e36e00f5b7de4;hpb=c477082cc277d2607213d588f6a5e2efe3ee286e;p=modules%2Fyacs.git diff --git a/src/salomeloader/testSalomeLoader.py.in b/src/salomeloader/testSalomeLoader.py.in index 339bf11bc..8cb5b3d8a 100755 --- a/src/salomeloader/testSalomeLoader.py.in +++ b/src/salomeloader/testSalomeLoader.py.in @@ -1,10 +1,10 @@ -#!/usr/bin/env python -# Copyright (C) 2006-2013 CEA/DEN, EDF R&D +#!/usr/bin/env python3 +# Copyright (C) 2006-2023 CEA, EDF # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -72,10 +72,9 @@ class TestSalomeLoader(unittest.TestCase): p.saveSchema("tata.xml") U = os.getenv('USER') -f=open("/tmp/" + U + "/UnitTestsResult", 'a') -f.write(" --- TEST src/salomeloader: testSalomeLoader.py\n") -suite = unittest.makeSuite(TestSalomeLoader) -result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite) -f.close() +with open("/tmp/" + U + "/UnitTestsResult", 'a') as f: + f.write(" --- TEST src/salomeloader: testSalomeLoader.py\n") + suite = unittest.makeSuite(TestSalomeLoader) + result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite) sys.exit(not result.wasSuccessful())