From: vsr Date: Thu, 7 Oct 2021 12:22:24 +0000 (+0300) Subject: bos #24412 Fix tests for 'salome test' mode X-Git-Tag: V9_8_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e81f6da96d436f9ca63797f7ed0e24b4b66b689;p=modules%2Fshaper.git bos #24412 Fix tests for 'salome test' mode --- diff --git a/src/ExchangePlugin/Test/TestImportImage_1.py b/src/ExchangePlugin/Test/TestImportImage_1.py index 12c575ef5..1c529e196 100755 --- a/src/ExchangePlugin/Test/TestImportImage_1.py +++ b/src/ExchangePlugin/Test/TestImportImage_1.py @@ -20,8 +20,13 @@ import os, inspect from salome.shaper import model +from PyQt5.Qt import QApplication + import salome +salome.salome_init_without_session() salome.salome_init(1) +if QApplication.instance() is None: + app = QApplication([]) data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data") diff --git a/src/ExchangePlugin/Test/TestImportImage_2.py b/src/ExchangePlugin/Test/TestImportImage_2.py index 29d72c33c..94b328fb3 100755 --- a/src/ExchangePlugin/Test/TestImportImage_2.py +++ b/src/ExchangePlugin/Test/TestImportImage_2.py @@ -20,8 +20,13 @@ import os, inspect from salome.shaper import model +from PyQt5.Qt import QApplication + import salome +salome.salome_init_without_session() salome.salome_init(1) +if QApplication.instance() is None: + app = QApplication([]) data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data")