From 4632c8d3c84f4e88dafb62c7a624c6a45a11cbee Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Tue, 17 Aug 2021 17:16:07 +0100 Subject: [PATCH 1/2] Skip the test if the failure is due to a connection error. --- test/test_videoapi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_videoapi.py b/test/test_videoapi.py index c6ae32232d3..18e53cc7dff 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,10 @@ 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) + 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() From 77460f3f5166b984e2584f1a61f52ef47f1f28ed Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Tue, 17 Aug 2021 18:00:08 +0100 Subject: [PATCH 2/2] Add todo. --- test/test_videoapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_videoapi.py b/test/test_videoapi.py index 18e53cc7dff..734620e8f74 100644 --- a/test/test_videoapi.py +++ b/test/test_videoapi.py @@ -178,6 +178,7 @@ def test_accurateseek_middle(self): assert (lb <= frame["pts"]) and (ub >= frame["pts"]) def test_fate_suite(self): + # 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: