Skip to content

Commit c136cab

Browse files
author
Molly Xu
committed
fix testcase
1 parent bff16e6 commit c136cab

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

test/test_encoders.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -935,26 +935,17 @@ def test_against_to_file(self, tmp_path, format, method):
935935
rtol=0,
936936
)
937937

938+
@needs_ffmpeg_cli
938939
@pytest.mark.parametrize(
939940
"format",
940-
[
941+
(
941942
"mov",
942943
"mp4",
943944
"avi",
944945
"mkv",
945946
"flv",
946-
pytest.param(
947-
"webm",
948-
marks=[
949-
pytest.mark.slow,
950-
pytest.mark.skipif(
951-
get_ffmpeg_major_version() == 4
952-
or (IS_WINDOWS and get_ffmpeg_major_version() in (6, 7)),
953-
reason="Codec for webm is not available in this FFmpeg installation.",
954-
),
955-
],
956-
),
957-
],
947+
pytest.param("webm", marks=pytest.mark.slow),
948+
),
958949
)
959950
@pytest.mark.parametrize(
960951
"encode_params",
@@ -969,6 +960,12 @@ def test_against_to_file(self, tmp_path, format, method):
969960
def test_video_encoder_against_ffmpeg_cli(
970961
self, tmp_path, format, encode_params, method
971962
):
963+
ffmpeg_version = get_ffmpeg_major_version()
964+
if format == "webm" and (
965+
ffmpeg_version == 4 or (IS_WINDOWS and ffmpeg_version in (6, 7))
966+
):
967+
pytest.skip("Codec for webm is not available in this FFmpeg installation.")
968+
972969
pixel_format = encode_params["pixel_format"]
973970
crf = encode_params["crf"]
974971
preset = encode_params["preset"]

0 commit comments

Comments
 (0)