From 9b12152e61cb3d6556dc88a323a8f35c5905bc99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Wed, 10 Aug 2016 11:13:59 +0200 Subject: [PATCH] Use real temporary file name for unit tests trace --- test/VisuPrs/bugs/A5.py | 5 +++-- test/VisuPrs/bugs/C5.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/VisuPrs/bugs/A5.py b/test/VisuPrs/bugs/A5.py index d5af545e..357194dc 100644 --- a/test/VisuPrs/bugs/A5.py +++ b/test/VisuPrs/bugs/A5.py @@ -34,9 +34,10 @@ data_file = datadir + "TimeStamps.med" tmp_dir = os.getenv("TmpDir") if tmp_dir == None: - tmp_dir = "/tmp" + import tempfile + tmp_dir = tempfile.mkdtemp() -save_file = tmp_dir + "/TimeStamps_save.hdf" +save_file = os.path.join(tmp_dir, "TimeStamps_save.hdf") print "Save to file ", save_file pvsimple.OpenDataFile(data_file) diff --git a/test/VisuPrs/bugs/C5.py b/test/VisuPrs/bugs/C5.py index d1e47240..f48af7b6 100644 --- a/test/VisuPrs/bugs/C5.py +++ b/test/VisuPrs/bugs/C5.py @@ -144,7 +144,8 @@ theDuration = 20 NbOfLoops = 4 #thePath = os.getenv("TMP_DIR") thePrefix = "TestPngFromAnim" -thePath = os.path.join("/tmp", thePrefix) +import tempfile +thePath = os.path.join(tempfile.mkdtemp(), thePrefix) thePath += ".png" displayMng = DisplayManager() -- 2.39.2