Skip to content

Commit

Permalink
Set QGIS_CUSTOM_CONFIG_PATH to temporary dir for python tests
Browse files Browse the repository at this point in the history
Partially fixes #34185
See also #34187
  • Loading branch information
strk committed Feb 3, 2020
1 parent db40d88 commit c23a197
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit c23a197

Please sign in to comment.