Salome HOME
updated copyright message
[modules/yacs.git] / src / yacsloader_swig / Test / testRefcount.py
index 599412751ba4a96153e3e7d11310c5f2236e7704..a7671a817234b861b3051cef5c021c44657e703f 100755 (executable)
@@ -1,4 +1,5 @@
-# Copyright (C) 2006-2016  CEA/DEN, EDF R&D
+#!/usr/bin/env python3
+# Copyright (C) 2006-2023  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
@@ -266,9 +267,11 @@ class TestTypeCodeRef(unittest.TestCase):
     self.assertEqual(tc.getRefCnt(), 3)
 
 if __name__ == '__main__':
+  import tempfile
   import os
-  U = os.getenv('USER')
-  with open("/tmp/" + U + "/UnitTestsResult", 'a') as f:
+  dir_test = tempfile.mkdtemp(suffix=".yacstest")
+  file_test = os.path.join(dir_test,"UnitTestsResult")
+  with open(file_test, 'a') as f:
       f.write("  --- TEST src/yacsloader: testRefcount.py\n")
       suite1 = unittest.makeSuite(TestContainerRef)
       suite2 = unittest.makeSuite(TestTypeCodeRef)