summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2022-04-07 14:47:05 -0700
committerChristian Schwede <cschwede@redhat.com>2022-06-30 12:01:51 +0200
commit8804225838f64480cbb9d22b44bc04d2cca5031b (patch)
treef13baea33a60f827a9516cdcb5d85b6fcf655bab
parent0fa745c7f94d60660d28fcbd5b085f8039c3c476 (diff)
downloadswift-8804225838f64480cbb9d22b44bc04d2cca5031b.tar.gz
tests: Fix swiftclient/requests log level & Ignore py36 deprecation warnings
Gotta update now that swiftclient changed how it imports and uses requests. Related-Change: https://review.opendev.org/c/openstack/python-swiftclient/+/828821 Change-Id: I0e0f802fa355060f43f9e63f52897fbcf66816d2 (cherry picked from commit a5a98d7e3bbcfb6d4e8cca8f4aca08cca4286b17) (cherry picked from commit 7298038ed90fe5824c250975045a6f0a3eb39d04)
-rw-r--r--swift/__init__.py4
-rw-r--r--test/__init__.py4
-rw-r--r--test/probe/test_sharder.py9
3 files changed, 15 insertions, 2 deletions
diff --git a/swift/__init__.py b/swift/__init__.py
index 88fc403ce..6168bdc8a 100644
--- a/swift/__init__.py
+++ b/swift/__init__.py
@@ -81,3 +81,7 @@ warnings.filterwarnings('ignore', module='cryptography|OpenSSL', message=(
'Python 2 is no longer supported by the Python core team. '
'Support for it is now deprecated in cryptography, '
'and will be removed in a future release.'))
+warnings.filterwarnings('ignore', message=(
+ 'Python 3.6 is no longer supported by the Python core team. '
+ 'Therefore, support for it is deprecated in cryptography '
+ 'and will be removed in a future release.'))
diff --git a/test/__init__.py b/test/__init__.py
index 363efb53c..22c63b9f4 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -42,6 +42,10 @@ warnings.filterwarnings('ignore', module='cryptography|OpenSSL', message=(
'Python 2 is no longer supported by the Python core team. '
'Support for it is now deprecated in cryptography, '
'and will be removed in a future release.'))
+warnings.filterwarnings('ignore', message=(
+ 'Python 3.6 is no longer supported by the Python core team. '
+ 'Therefore, support for it is deprecated in cryptography '
+ 'and will be removed in a future release.'))
from eventlet.green import socket
diff --git a/test/probe/test_sharder.py b/test/probe/test_sharder.py
index f702a73b2..b5680b9ee 100644
--- a/test/probe/test_sharder.py
+++ b/test/probe/test_sharder.py
@@ -42,6 +42,11 @@ from test.probe.common import ReplProbeTest, get_server_number, \
wait_for_server_to_hangup
import mock
+try:
+ from swiftclient.requests_compat import requests as client_requests
+except ImportError:
+ # legacy location
+ from swiftclient.client import requests as client_requests
MIN_SHARD_CONTAINER_THRESHOLD = 4
MAX_SHARD_CONTAINER_THRESHOLD = 100
@@ -116,8 +121,8 @@ class BaseTestContainerSharding(ReplProbeTest):
def setUp(self):
client.logger.setLevel(client.logging.WARNING)
- client.requests.logging.getLogger().setLevel(
- client.requests.logging.WARNING)
+ client_requests.logging.getLogger().setLevel(
+ client_requests.logging.WARNING)
super(BaseTestContainerSharding, self).setUp()
_, self.admin_token = get_auth(
PROXY_BASE_URL + '/auth/v1.0', 'admin:admin', 'admin')