use temp_dir kwarg instead

This commit is contained in:
Wing Lian
2023-11-06 07:31:46 -05:00
parent 7de6a5639c
commit 6dc68a653f
6 changed files with 31 additions and 31 deletions

View File

@@ -14,7 +14,7 @@ def with_temp_dir(test_func):
temp_dir = tempfile.mkdtemp()
try:
# Pass the temporary directory to the test function
test_func(temp_dir, *args, **kwargs)
test_func(*args, temp_dir=temp_dir, **kwargs)
finally:
# Clean up the directory after the test
shutil.rmtree(temp_dir)