diff --git a/tests/src/python/test_processing_algs_gdal_gdalutils.py b/tests/src/python/test_processing_algs_gdal_gdalutils.py index b4569b0f60ec..ded8357ff8bc 100644 --- a/tests/src/python/test_processing_algs_gdal_gdalutils.py +++ b/tests/src/python/test_processing_algs_gdal_gdalutils.py @@ -10,6 +10,10 @@ __copyright__ = 'Copyright 2024, The QGIS Project' +import os +import tempfile +from shutil import rmtree + import unittest from qgis.testing import start_app, QgisTestCase from qgis.core import QgsApplication, QgsRasterLayer, QgsDataSourceUri, QgsAuthMethodConfig @@ -18,11 +22,21 @@ GdalConnectionDetails ) +QGIS_AUTH_DB_DIR_PATH = tempfile.mkdtemp() +os.environ['QGIS_AUTH_DB_DIR_PATH'] = QGIS_AUTH_DB_DIR_PATH + start_app() class TestProcessingAlgsGdalGdalUtils(QgisTestCase): + @classmethod + def tearDownClass(cls): + """Run after all tests""" + rmtree(QGIS_AUTH_DB_DIR_PATH) + del os.environ['QGIS_AUTH_DB_DIR_PATH'] + super().tearDownClass() + def test_gdal_connection_details_from_layer_postgresraster(self): """ Test GdalUtils.gdal_connection_details_from_layer