From b0fddeb29a67691bc5a31815f3e77b1355490559 Mon Sep 17 00:00:00 2001 From: nohehf Date: Tue, 21 May 2024 17:56:22 +0200 Subject: [PATCH] fix: string_to_virtual_repo helper --- tests/helpers/virtual_files.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/helpers/virtual_files.py b/tests/helpers/virtual_files.py index 27783e3..736b77b 100644 --- a/tests/helpers/virtual_files.py +++ b/tests/helpers/virtual_files.py @@ -128,8 +128,7 @@ def string_to_virtual_repo( ``` """ files = _split_files(string) - temp_dir = tempfile.mkdtemp() - temp_dir = os.path.abspath(tempfile.mkdtemp()) + temp_dir = os.path.abspath(tempfile.mkdtemp(dir=".")) positions_map = {} for file_path, file_content in files: abs_path = os.path.join(temp_dir, file_path) @@ -143,8 +142,5 @@ def string_to_virtual_repo( with open(full_path, "w") as f: f.write(file_content) yield temp_dir, positions_map - except Exception as e: - print(e) finally: - print("Removing temp dir") shutil.rmtree(temp_dir)