aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2020-08-21 17:38:25 -0400
committerMicah Lee <micah@micahflee.com>2020-08-21 17:38:25 -0400
commit176368a22b89cd83dc11bfefe7baa80dcfdd7bec (patch)
tree91fd6b7b3cc4af0f944cc5fb19b104fff9a6e26f /tests
parentb1a8c1054bcb194138d40119af46c7a24a4d426f (diff)
downloadonionshare-176368a22b89cd83dc11bfefe7baa80dcfdd7bec.tar.gz
onionshare-176368a22b89cd83dc11bfefe7baa80dcfdd7bec.zip
Close test temporary file before returning, to avoid permission denied error in windows
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 200f526d..ba0f1e72 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -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