mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 19:52:50 -03:00
Close test temporary file before returning, to avoid permission denied error in windows
This commit is contained in:
parent
b1a8c1054b
commit
176368a22b
1 changed files with 2 additions and 1 deletions
|
@ -98,9 +98,10 @@ def temp_file_1024_delete(temp_dir):
|
|||
The temporary file will be deleted after fixture usage.
|
||||
"""
|
||||
|
||||
with tempfile.NamedTemporaryFile(dir=temp_dir) as tmp_file:
|
||||
with tempfile.NamedTemporaryFile(dir=temp_dir, delete=False) as tmp_file:
|
||||
tmp_file.write(b"*" * 1024)
|
||||
tmp_file.flush()
|
||||
tmp_file.close()
|
||||
yield tmp_file.name
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue