Skip to content

Commit

Permalink
Skip test if connection issues on fate (#4284)
Browse files Browse the repository at this point in the history
* Skip the test if the failure is due to a connection error.

* Add todo.
  • Loading branch information
datumbox authored Aug 17, 2021
1 parent ddd14ff commit af16236
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_videoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import pytest
from pytest import approx
import urllib

import torch
import torchvision
Expand Down Expand Up @@ -177,7 +178,11 @@ def test_accurateseek_middle(self):
assert (lb <= frame["pts"]) and (ub >= frame["pts"])

def test_fate_suite(self):
video_path = fate("sub/MovText_capability_tester.mp4", VIDEO_DIR)
# TODO: remove the try-except statement once the connectivity issues are resolved
try:
video_path = fate("sub/MovText_capability_tester.mp4", VIDEO_DIR)
except (urllib.error.URLError, ConnectionError) as error:
pytest.skip(f"Skipping due to connectivity issues: {error}")
vr = VideoReader(video_path)
metadata = vr.get_metadata()

Expand Down

0 comments on commit af16236

Please sign in to comment.