Skip to content

Commit

Permalink
Add test to test_close_temp_files using delete=False
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsalamon committed Oct 5, 2017
1 parent 060114d commit 0ddd742
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def test_close_temp_files():
deleted.
'''
# With delete=True
tmpfiles = []

with _close_temp_files(tmpfiles):
for _ in range(5):
tmpfiles.append(
Expand All @@ -57,6 +57,17 @@ def test_close_temp_files():
assert tf.file.closed
assert not os.path.isfile(tf.name)

# With delete=False
tmpfiles = []
with _close_temp_files(tmpfiles):
for _ in range(5):
tmpfiles.append(
tempfile.NamedTemporaryFile(suffix='.wav', delete=False))

for tf in tmpfiles:
assert tf.file.closed
assert not os.path.isfile(tf.name)


def test_set_temp_logging_level():
'''
Expand Down

0 comments on commit 0ddd742

Please sign in to comment.