From c23a19793aead4d4b39233af0f46ef0dc0183f30 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sat, 1 Feb 2020 12:12:17 +0100 Subject: [PATCH] Set QGIS_CUSTOM_CONFIG_PATH to temporary dir for python tests Partially fixes #34185 See also #34187 --- python/testing/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/testing/__init__.py b/python/testing/__init__.py index 1e8e8785d56b..436c15f995d2 100644 --- a/python/testing/__init__.py +++ b/python/testing/__init__.py @@ -26,6 +26,7 @@ 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())