From af16236dc275b524a9b46b84567490afab25cc61 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Tue, 17 Aug 2021 18:00:25 +0100 Subject: [PATCH] Skip test if connection issues on fate (#4284) * Skip the test if the failure is due to a connection error. * Add todo. --- test/test_videoapi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_videoapi.py b/test/test_videoapi.py index c6ae32232d3..734620e8f74 100644 --- a/test/test_videoapi.py +++ b/test/test_videoapi.py @@ -2,6 +2,7 @@ import os import pytest from pytest import approx +import urllib import torch import torchvision @@ -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()