Skip to content

Commit

Permalink
fix: suppress errors when deleting temp dir [GispoCoding#41]
Browse files Browse the repository at this point in the history
  • Loading branch information
Joonalai committed Jun 29, 2023
1 parent d81a06d commit 18fbbda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pytest_qgis/pytest_qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with pytest-qgis. If not, see <https://www.gnu.org/licenses/>.


import contextlib
import os.path
import shutil
import sys
Expand Down Expand Up @@ -155,7 +155,8 @@ def qgis_app(request: "SubRequest") -> QgsApplication:
_CANVAS.deleteLater()
_APP.exitQgis()
if _QGIS_CONFIG_PATH and _QGIS_CONFIG_PATH.exists():
shutil.rmtree(_QGIS_CONFIG_PATH)
with contextlib.suppress(PermissionError):
shutil.rmtree(_QGIS_CONFIG_PATH)


@pytest.fixture(scope="session")
Expand Down

0 comments on commit 18fbbda

Please sign in to comment.