From 498efa6c9b8333ec2a4482ba1eed37ba98a0369f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Tue, 25 May 2021 12:18:52 +0200 Subject: [PATCH] Fix test error in Windows --- tests/test_ffmpeg_tools.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_ffmpeg_tools.py b/tests/test_ffmpeg_tools.py index 712120b0c..7c817f181 100644 --- a/tests/test_ffmpeg_tools.py +++ b/tests/test_ffmpeg_tools.py @@ -41,7 +41,10 @@ def test_ffmpeg_extract_subclip(): assert 0.18 <= clip.duration <= 0.22 # not accurate if os.path.isdir(extract_subclip_tempdir): - shutil.rmtree(extract_subclip_tempdir) + try: + shutil.rmtree(extract_subclip_tempdir) + except PermissionError: + pass def test_ffmpeg_resize(): @@ -63,7 +66,10 @@ def test_ffmpeg_resize(): assert clip.size[1] == expected_size[1] if os.path.isfile(outputfile): - os.remove(outputfile) + try: + os.remove(outputfile) + except PermissionError: + pass def test_ffmpeg_stabilize_video(): @@ -103,7 +109,10 @@ def test_ffmpeg_stabilize_video(): ) if os.path.isdir(stabilize_video_tempdir): - shutil.rmtree(stabilize_video_tempdir) + try: + shutil.rmtree(stabilize_video_tempdir) + except PermissionError: + pass if __name__ == "__main__":