diff --git a/tests/test_util.py b/tests/test_util.py index c4b063a..c2508c2 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -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( @@ -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(): '''