Skip to content

Commit 44d40a1

Browse files
Dan-Floresfacebook-github-bot
authored andcommitted
Disable ffprobe test internally
Summary: Tests related to `custom_frame_mappings` that utilize ffprobe should be skipped internally as ffprobe is not available. In addition to adding the `pytest.skip` decorator to these tests, I removed `custom_frame_mapping` generation from `pytest.mark.parametrize` in `test_custom_frame_mappings_init_fails` to allow tests to run. Reviewed By: scotts Differential Revision: D82378431
1 parent ab026c8 commit 44d40a1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

test/test_decoders.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,10 @@ def setup_frame_mappings(tmp_path, file, stream_index):
12921292
# Return the custom frame mappings as a JSON string
12931293
return custom_frame_mappings
12941294

1295+
@pytest.mark.skipif(
1296+
in_fbcode(),
1297+
reason="ffprobe not available internally",
1298+
)
12951299
@pytest.mark.parametrize("device", all_supported_devices())
12961300
@pytest.mark.parametrize("stream_index", [0, 3])
12971301
@pytest.mark.parametrize(
@@ -1338,12 +1342,16 @@ def test_custom_frame_mappings_json_and_bytes(
13381342
),
13391343
)
13401344

1345+
@pytest.mark.skipif(
1346+
in_fbcode(),
1347+
reason="ffprobe not available internally",
1348+
)
13411349
@pytest.mark.parametrize("device", all_supported_devices())
13421350
@pytest.mark.parametrize(
13431351
"custom_frame_mappings,expected_match",
13441352
[
13451353
pytest.param(
1346-
NASA_VIDEO.generate_custom_frame_mappings(0),
1354+
None,
13471355
"seek_mode",
13481356
id="valid_content_approximate",
13491357
),
@@ -1361,6 +1369,8 @@ def test_custom_frame_mappings_json_and_bytes(
13611369
def test_custom_frame_mappings_init_fails(
13621370
self, device, custom_frame_mappings, expected_match
13631371
):
1372+
if custom_frame_mappings == None:
1373+
custom_frame_mappings = NASA_VIDEO.generate_custom_frame_mappings(0)
13641374
with pytest.raises(ValueError, match=expected_match):
13651375
VideoDecoder(
13661376
NASA_VIDEO.path,

test/test_ops.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import os
1010
from functools import partial
1111

12+
from pytorch.torchcodec.test.utils import in_fbcode
13+
1214
os.environ["TORCH_LOGS"] = "output_code"
1315
import json
1416
import subprocess
@@ -480,6 +482,10 @@ def test_frame_pts_equality(self):
480482
)
481483
assert pts_is_equal
482484

485+
@pytest.mark.skipif(
486+
in_fbcode(),
487+
reason="ffprobe not available internally",
488+
)
483489
def test_seek_mode_custom_frame_mappings_fails(self):
484490
decoder = create_from_file(
485491
str(NASA_VIDEO.path), seek_mode="custom_frame_mappings"

0 commit comments

Comments
 (0)