eric6_unittest.py

changeset 4343
afe0da217745
parent 4289
6c1ab651c9ce
child 4631
5c1a96925da4
--- a/eric6_unittest.py	Tue Jul 28 19:19:23 2015 +0200
+++ b/eric6_unittest.py	Sat Aug 01 13:41:33 2015 +0200
@@ -17,19 +17,27 @@
 import Toolbox.PyQt4ImportHook  # __IGNORE_WARNING__
 
 try:  # Only for Py2
-    import Utilities.compatibility_fixes     # __IGNORE_WARNING__
+    import Globals.compatibility_fixes     # __IGNORE_WARNING__
 except (ImportError):
     pass
 
 import sys
+import os
 
-for arg in sys.argv:
+for arg in sys.argv[:]:
     if arg.startswith("--config="):
         import Globals
         configDir = arg.replace("--config=", "")
         Globals.setConfigDir(configDir)
         sys.argv.remove(arg)
-        break
+    elif arg.startswith("--settings="):
+        from PyQt5.QtCore import QSettings
+        settingsDir = os.path.expanduser(arg.replace("--settings=", ""))
+        if not os.path.isdir(settingsDir):
+            os.makedirs(settingsDir)
+        QSettings.setPath(QSettings.IniFormat, QSettings.UserScope,
+                          settingsDir)
+        sys.argv.remove(arg)
 
 from Globals import AppInfo
 
@@ -58,6 +66,8 @@
     options = [
         ("--config=configDir",
          "use the given directory as the one containing the config files"),
+        ("--settings=settingsDir",
+         "use the given directory to store the settings files"),
     ]
     appinfo = AppInfo.makeAppInfo(sys.argv,
                                   "Eric6 Unittest",

eric ide

mercurial