Skip to content

Commit 6dac476

Browse files
committed
Skip TLSv1 and TLSv1.1 tests for MySQL > 8.0.27 and > 5.7.36
1 parent c72ae52 commit 6dac476

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

tests/test_connection.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
import logging
3535
import os
3636
import platform
37-
import ssl
3837
import socket
39-
import subprocess
4038
import sys
4139
import timeit
4240
import unittest
@@ -2451,8 +2449,14 @@ def test_connection_attributes_defaults(self):
24512449
"This test fails due to a bug on macOS 12",
24522450
)
24532451
@unittest.skipIf(tests.MYSQL_VERSION < (5, 7, 40), "TLSv1.1 incompatible")
2454-
@unittest.skipUnless(ssl.HAS_TLSv1, "TLSv1 not available")
2455-
@unittest.skipUnless(ssl.HAS_TLSv1_1, "TLSv1.1 not available")
2452+
@unittest.skipIf(
2453+
tests.MYSQL_VERSION > (8, 0, 27),
2454+
"TLSv1 and TLSv1.1 support removed as of MySQL 8.0.28",
2455+
)
2456+
@unittest.skipIf(
2457+
tests.MYSQL_VERSION > (5, 7, 36) and tests.MYSQL_VERSION < (5, 8, 0),
2458+
"TLSv1 and TLSv1.1 support removed as of MySQL 5.7.37",
2459+
)
24562460
@tests.foreach_cnx()
24572461
def test_get_connection_with_tls_version(self):
24582462
if isinstance(self.cnx, connection.MySQLConnection):

tests/test_mysqlx_connection.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import os
3636
import platform
3737
import random
38-
import ssl
3938
import socket
4039
import string
4140
import struct
@@ -1348,8 +1347,14 @@ def test_ssl_connection(self):
13481347
"This test fails due to a bug on macOS 12",
13491348
)
13501349
@unittest.skipIf(tests.MYSQL_VERSION < (5, 7, 40), "TLSv1.1 incompatible")
1351-
@unittest.skipUnless(ssl.HAS_TLSv1, "TLSv1 not available")
1352-
@unittest.skipUnless(ssl.HAS_TLSv1_1, "TLSv1.1 not available")
1350+
@unittest.skipIf(
1351+
tests.MYSQL_VERSION > (8, 0, 27),
1352+
"TLSv1 and TLSv1.1 support removed as of MySQL 8.0.28",
1353+
)
1354+
@unittest.skipIf(
1355+
tests.MYSQL_VERSION > (5, 7, 36) and tests.MYSQL_VERSION < (5, 8, 0),
1356+
"TLSv1 and TLSv1.1 support removed as of MySQL 5.7.37",
1357+
)
13531358
def test_get_session_with_tls_version(self):
13541359
# Test None value is returned if no schema name is specified
13551360
settings = self.connect_kwargs.copy()

0 commit comments

Comments
 (0)