From 3e81f6da96d436f9ca63797f7ed0e24b4b66b689 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 7 Oct 2021 15:22:24 +0300 Subject: [PATCH] bos #24412 Fix tests for 'salome test' mode --- src/ExchangePlugin/Test/TestImportImage_1.py | 5 +++++ src/ExchangePlugin/Test/TestImportImage_2.py | 5 +++++ 2 files changed, 10 insertions(+) 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") -- 2.39.2