From 56133f85faa1bd9a280cbbdd0849abb9a0bfceea Mon Sep 17 00:00:00 2001 From: hay-kot Date: Tue, 6 Apr 2021 12:02:45 -0800 Subject: [PATCH] fix test cleanup --- tests/unit_tests/test_config.py | 2 +- tests/unit_tests/test_nextcloud.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_config.py b/tests/unit_tests/test_config.py index d434e12ad..c2641b428 100644 --- a/tests/unit_tests/test_config.py +++ b/tests/unit_tests/test_config.py @@ -29,7 +29,7 @@ def test_non_default_settings(monkeypatch): monkeypatch.setenv("DEFAULT_GROUP", "Test Group") monkeypatch.setenv("DEFAULT_PASSWORD", "Test Password") monkeypatch.setenv("API_PORT", "8000") - monkeypatch.setenv("API_DOCS", False) + monkeypatch.setenv("API_DOCS", 'False') app_settings = AppSettings() diff --git a/tests/unit_tests/test_nextcloud.py b/tests/unit_tests/test_nextcloud.py index 3e446e76c..bb773fc39 100644 --- a/tests/unit_tests/test_nextcloud.py +++ b/tests/unit_tests/test_nextcloud.py @@ -1,3 +1,4 @@ +import shutil from pathlib import Path import pytest @@ -36,4 +37,4 @@ def test_zip_extraction(file_name: str, final_path: Path): def test_nextcloud_migration(recipe_dir: Path): recipe = import_recipes(recipe_dir) assert isinstance(recipe, Recipe) - app_dirs.IMG_DIR.joinpath(recipe.image).unlink(missing_ok=True) + shutil.rmtree(app_dirs.IMG_DIR.joinpath(recipe.image), ignore_errors=True)