From 7bce2ad441b874e7a1cf8cc81059c5601d832697 Mon Sep 17 00:00:00 2001 From: dirkf Date: Thu, 20 Jul 2023 18:49:48 +0100 Subject: [build] Fix various Jython CI and test issues --- test/test_http.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test/test_http.py') diff --git a/test/test_http.py b/test/test_http.py index 1a6b2e878..4ec8e13e3 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -45,6 +45,7 @@ from youtube_dl.utils import ( ) from test.helper import ( + expectedFailureIf, FakeYDL, FakeLogger, http_server_port, @@ -243,6 +244,11 @@ class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler): class TestHTTP(unittest.TestCase): + # when does it make sense to check the SSL certificate? + _check_cert = ( + sys.version_info >= (3, 2) + or (sys.version_info[0] == 2 and sys.version_info[1:] >= (7, 19))) + def setUp(self): # HTTP server self.http_httpd = compat_http_server.HTTPServer( @@ -307,10 +313,7 @@ class TestHTTP(unittest.TestCase): else self.https_port if scheme == 'https' else self.http_port, path) - @unittest.skipUnless( - sys.version_info >= (3, 2) - or (sys.version_info[0] == 2 and sys.version_info[1:] >= (7, 9)), - 'No support for certificate check in SSL') + @unittest.skipUnless(_check_cert, 'No support for certificate check in SSL') def test_nocheckcertificate(self): with FakeYDL({'logger': FakeLogger()}) as ydl: with self.assertRaises(compat_urllib_error.URLError): @@ -376,6 +379,8 @@ class TestHTTP(unittest.TestCase): with self.assertRaises(compat_urllib_HTTPError): do_req(code, 'GET') + # Jython 2.7.1 times out for some reason + @expectedFailureIf(sys.platform.startswith('java') and sys.version_info < (2, 7, 2)) def test_content_type(self): # https://github.com/yt-dlp/yt-dlp/commit/379a4f161d4ad3e40932dcf5aca6e6fb9715ab28 with FakeYDL({'nocheckcertificate': True}) as ydl: -- cgit v1.2.3