Skip to content

Video editing with Python

Removed deprecated parameter from pytest.raises()

Julian-Od325b3003b9d
diff --git a/tests/test_ImageSequenceClip.py b/tests/test_ImageSequenceClip.py
index e2115222..53526065 100644
--- a/tests/test_ImageSequenceClip.py
+++ b/tests/test_ImageSequenceClip.py
@@ -32,7 +32,7 @@ def test_2():
images.append("media/matplotlib_demo1.png")
#images are not the same size..
- with pytest.raises(Exception, message='Expecting Exception'):
+ with pytest.raises(Exception):
ImageSequenceClip(images, durations=durations).close()
diff --git a/tests/test_PR.py b/tests/test_PR.py
index d28f1af9..246d2ade 100644
--- a/tests/test_PR.py
+++ b/tests/test_PR.py
@@ -18,7 +18,7 @@ def test_PR_306():
assert TextClip.list('font') != []
assert TextClip.list('color') != []
- with pytest.raises(Exception, message="Expecting Exception"):
+ with pytest.raises(Exception):
TextClip.list('blah')
close_all_clips(locals())
diff --git a/tests/test_compositing.py b/tests/test_compositing.py
index 14622869..c09d6999 100644
--- a/tests/test_compositing.py
+++ b/tests/test_compositing.py
@@ -15,8 +15,7 @@ def test_clips_array():
video = clips_array([[red, green, blue]])
- with pytest.raises(ValueError,
- message="Expecting ValueError (duration not set)"):
+ with pytest.raises(ValueError): # duration not set
video.resize(width=480).write_videofile(
join(TMP_DIR, "test_clips_array.mp4"))
close_all_clips(locals())
@@ -30,8 +29,7 @@ def test_clips_array_duration():
blue = ColorClip((256, 200), color=(0, 0, 255))
video = clips_array([[red, green, blue]]).set_duration(5)
- with pytest.raises(AttributeError,
- message="Expecting ValueError (fps not set)"):
+ with pytest.raises(AttributeError): # fps not set
video.write_videofile(join(TMP_DIR, "test_clips_array.mp4"))
# this one should work correctly
diff --git a/tests/test_issues.py b/tests/test_issues.py
index 3be70905..4bf0c022 100644
--- a/tests/test_issues.py
+++ b/tests/test_issues.py
@@ -14,7 +14,7 @@ from moviepy.video.fx.resize import resize
def test_issue_145():
video = ColorClip((800, 600), color=(255, 0, 0)).set_duration(5)
- with pytest.raises(Exception, message='Expecting Exception'):
+ with pytest.raises(Exception):
concatenate_videoclips([video], method='composite')
@@ -223,10 +223,10 @@ def test_issue_407():
assert green.h == blue.h == 480
assert green.size == blue.size == (640, 480)
- with pytest.raises(AttributeError, message="Expecting ValueError Exception"):
+ with pytest.raises(AttributeError):
green.fps
- with pytest.raises(AttributeError, message="Expecting ValueError Exception"):
+ with pytest.raises(AttributeError):
blue.fps
video = concatenate_videoclips([red, green, blue])
@@ -262,7 +262,7 @@ def test_issue_470():
# t_end is out of bounds
subclip = audio_clip.subclip(t_start=6, t_end=9)
- with pytest.raises(IOError, message="Expecting IOError"):
+ with pytest.raises(IOError):
subclip.write_audiofile(os.path.join(
TMP_DIR, 'issue_470.wav'), write_logfile=True)
diff --git a/tests/test_tools.py b/tests/test_tools.py
index 2c276b4a..3711f16e 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -19,8 +19,8 @@ def test_ext():
def test_2():
"""Test for raising erre if codec not in dictionaries."""
- message = "asking for a silly video format did not Raise a Value Error"
- with pytest.raises(ValueError, message=message):
+
+ with pytest.raises(ValueError): # asking for a silly video format
tools.find_extension('flashvideo')
def test_3():