diff --git a/tests/test_connection.py b/tests/test_connection.py index 58c1bd7e..06463383 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -34,9 +34,7 @@ import logging import os import platform -import ssl import socket -import subprocess import sys import timeit import unittest @@ -2451,8 +2449,14 @@ def test_connection_attributes_defaults(self): "This test fails due to a bug on macOS 12", ) @unittest.skipIf(tests.MYSQL_VERSION < (5, 7, 40), "TLSv1.1 incompatible") - @unittest.skipUnless(ssl.HAS_TLSv1, "TLSv1 not available") - @unittest.skipUnless(ssl.HAS_TLSv1_1, "TLSv1.1 not available") + @unittest.skipIf( + tests.MYSQL_VERSION > (8, 0, 27), + "TLSv1 and TLSv1.1 support removed as of MySQL 8.0.28", + ) + @unittest.skipIf( + tests.MYSQL_VERSION > (5, 7, 36) and tests.MYSQL_VERSION < (5, 8, 0), + "TLSv1 and TLSv1.1 support removed as of MySQL 5.7.37", + ) @tests.foreach_cnx() def test_get_connection_with_tls_version(self): if isinstance(self.cnx, connection.MySQLConnection): diff --git a/tests/test_mysqlx_connection.py b/tests/test_mysqlx_connection.py index 928fff25..84ddef17 100644 --- a/tests/test_mysqlx_connection.py +++ b/tests/test_mysqlx_connection.py @@ -35,7 +35,6 @@ import os import platform import random -import ssl import socket import string import struct @@ -1348,8 +1347,14 @@ def test_ssl_connection(self): "This test fails due to a bug on macOS 12", ) @unittest.skipIf(tests.MYSQL_VERSION < (5, 7, 40), "TLSv1.1 incompatible") - @unittest.skipUnless(ssl.HAS_TLSv1, "TLSv1 not available") - @unittest.skipUnless(ssl.HAS_TLSv1_1, "TLSv1.1 not available") + @unittest.skipIf( + tests.MYSQL_VERSION > (8, 0, 27), + "TLSv1 and TLSv1.1 support removed as of MySQL 8.0.28", + ) + @unittest.skipIf( + tests.MYSQL_VERSION > (5, 7, 36) and tests.MYSQL_VERSION < (5, 8, 0), + "TLSv1 and TLSv1.1 support removed as of MySQL 5.7.37", + ) def test_get_session_with_tls_version(self): # Test None value is returned if no schema name is specified settings = self.connect_kwargs.copy()