Skip to content

Commit

Permalink
Skip TLSv1 and TLSv1.1 tests for MySQL > 8.0.27 and > 5.7.36
Browse files Browse the repository at this point in the history
  • Loading branch information
nmariz committed Sep 8, 2022
1 parent c72ae52 commit 6dac476
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 8 additions & 4 deletions tests/test_connection.py
Expand Up @@ -34,9 +34,7 @@
import logging
import os
import platform
import ssl
import socket
import subprocess
import sys
import timeit
import unittest
Expand Down Expand Up @@ -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):
Expand Down
11 changes: 8 additions & 3 deletions tests/test_mysqlx_connection.py
Expand Up @@ -35,7 +35,6 @@
import os
import platform
import random
import ssl
import socket
import string
import struct
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 6dac476

Please sign in to comment.