Salome HOME
bos #24412 Fix tests for 'salome test' mode
[modules/shaper.git] / src / ExchangePlugin / Test / TestImportImage_1.py
index 2c974d6bf62b120f40eceafef99e78f590806537..1c529e1963b575278c5d64d7b8a00703904e369d 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import os
+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(sys.argv[0]), "data")
+data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data")
 
 model.begin()
 partSet = model.moduleDocument()