Set QGIS_CUSTOM_CONFIG_PATH to temporary dir for python tests

Partially fixes #34185
See also #34187
This commit is contained in:
Sandro Santilli 2020-02-01 12:12:17 +01:00
parent db40d88e8d
commit c23a19793a

View File

@ -26,6 +26,7 @@ import sys
import difflib
import functools
import filecmp
import tempfile
from qgis.PyQt.QtCore import QVariant
from qgis.core import QgsApplication, QgsFeatureRequest, NULL
@ -421,6 +422,7 @@ def start_app(cleanup=True):
# no need to mess with it here.
QGISAPP = QgsApplication(argvb, myGuiFlag)
os.environ['QGIS_CUSTOM_CONFIG_PATH'] = tempfile.mkdtemp('', 'QGIS-PythonTestConfigPath')
QGISAPP.initQgis()
print(QGISAPP.showSettings())