Skip to content

Commit

Permalink
fix: string_to_virtual_repo helper
Browse files Browse the repository at this point in the history
  • Loading branch information
nohehf committed May 21, 2024
1 parent 494614f commit b0fddeb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tests/helpers/virtual_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit b0fddeb

Please sign in to comment.