From 993ba7a20ba0b06e19606b6871f7fe9f178cf56c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 4 Jun 2024 14:06:29 +0200 Subject: [PATCH] Suppress YouTube Test `ConnectionError` (#13357) --- tests/test_python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_python.py b/tests/test_python.py index a52f7d6e..b874881b 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -140,7 +140,8 @@ def test_youtube(): model = YOLO(MODEL) try: model.predict("https://youtu.be/G17sBkb38XQ", imgsz=96, save=True) - except urllib.error.HTTPError as e: # handle 'urllib.error.HTTPError: HTTP Error 429: Too Many Requests' + # Handle internet connection errors and 'urllib.error.HTTPError: HTTP Error 429: Too Many Requests' + except (urllib.error.HTTPError, ConnectionError) as e: LOGGER.warning(f"WARNING: YouTube Test Error: {e}")