Skip to content

Video editing with Python

Move PR test to test_PR.py file (#444)

Billy Earneyfd36a54f2816
diff --git a/tests/test_PR.py b/tests/test_PR.py
index d9c3392b..3212543e 100644
--- a/tests/test_PR.py
+++ b/tests/test_PR.py
@@ -8,6 +8,7 @@ import pytest
from moviepy.editor import *
+global knights, knights10
def download_youtube_video(url, filename):
if not os.path.exists(filename):
@@ -16,6 +17,25 @@ def download_youtube_video(url, filename):
print("Downloading complete...\n")
+def test_download_media(capsys):
+ global knights, knights10
+
+ with capsys.disabled():
+ download_youtube_video("zvCvOC2VwDc", "media/knights.mp4")
+
+ knights=VideoFileClip("media/knights.mp4")
+ knights10 = knights.subclip(60,70)
+
+
+
+def test_PR_306():
+ assert TextClip.list('font') != []
+ assert TextClip.list('color') != []
+
+ with pytest.raises(Exception, message="Expecting Exception"):
+ TextClip.list('blah')
+
+
def test_PR_339():
#in caption mode
overlay = TextClip(txt='foo',
@@ -27,3 +47,6 @@ def test_PR_339():
#in_label_mode
overlay = TextClip(txt='foo', method='label')
+
+if __name__ == '__main__':
+ pytest.main()
diff --git a/tests/test_issues.py b/tests/test_issues.py
index 3a0be935..d0225774 100644
--- a/tests/test_issues.py
+++ b/tests/test_issues.py
@@ -2,17 +2,11 @@
Tests meant to be run with pytest
"""
-import sys
import os
import pytest
from moviepy.editor import *
-
-#@pytest.fixture
-#def example_video1():
-# pass
-
global knights, knights10
def download_youtube_video(url, filename):
@@ -50,12 +44,5 @@ def test_issue_407():
#assert _video.fps == None
-def test_PR_306():
- assert TextClip.list('font') != []
- assert TextClip.list('color') != []
-
- with pytest.raises(Exception, message="Expecting Exception"):
- TextClip.list('blah')
-
if __name__ == '__main__':
pytest.main()