diff --git a/test/test_execution.py b/test/test_execution.py index 20e821e4..d0357076 100644 --- a/test/test_execution.py +++ b/test/test_execution.py @@ -1,6 +1,5 @@ import os from pathlib import Path -import shutil from unittest import mock import pytest from utils import assert_files @@ -10,9 +9,10 @@ @pytest.fixture -def temp_output_dir(tmp_path): - yield str(tmp_path) + os.sep - shutil.rmtree(tmp_path) +def temp_output_dir(tmp_path: Path) -> str: + # Append path separator so that value is recognized as a directory when + # passed to `output_prefix` + return str(tmp_path) + os.sep def test_sanity_green(temp_output_dir): diff --git a/test/utils.py b/test/utils.py index d62899dc..f5ba0d43 100644 --- a/test/utils.py +++ b/test/utils.py @@ -16,10 +16,10 @@ def assert_files(parent_dir, file_list, exists=True): if exists: for file_path in file_list: assert Path( - parent_dir + file_path + parent_dir, file_path ).exists(), f"Expected file does not exist: {file_path}" else: for file_path in file_list: assert not Path( - parent_dir + file_path + parent_dir, file_path ).exists(), f"Unexpected file should not exist: {file_path}"