From 5c6d61f141a4316bea49bdeb6cdff5b6ea11a0f0 Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 1 Oct 2021 14:12:11 +0300 Subject: [PATCH] Issue #24412: TestImportImage_1.py TestImportImage_2.py failing Use another approach to get the full path for the test case. --- src/ExchangePlugin/Test/TestImportImage_1.py | 4 ++-- src/ExchangePlugin/Test/TestImportImage_2.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ExchangePlugin/Test/TestImportImage_1.py b/src/ExchangePlugin/Test/TestImportImage_1.py index 2c974d6bf..12c575ef5 100755 --- a/src/ExchangePlugin/Test/TestImportImage_1.py +++ b/src/ExchangePlugin/Test/TestImportImage_1.py @@ -17,13 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import os +import os, inspect from salome.shaper import model import salome salome.salome_init(1) -data_dir = os.path.join(os.path.dirname(sys.argv[0]), "data") +data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data") model.begin() partSet = model.moduleDocument() diff --git a/src/ExchangePlugin/Test/TestImportImage_2.py b/src/ExchangePlugin/Test/TestImportImage_2.py index 025bd9267..29d72c33c 100755 --- a/src/ExchangePlugin/Test/TestImportImage_2.py +++ b/src/ExchangePlugin/Test/TestImportImage_2.py @@ -17,13 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import os +import os, inspect from salome.shaper import model import salome salome.salome_init(1) -data_dir = os.path.join(os.path.dirname(sys.argv[0]), "data") +data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data") from tempfile import TemporaryDirectory tmp_dir = TemporaryDirectory() -- 2.39.2