diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-06-24 23:20:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 23:20:40 (GMT) |
commit | 22e7effad571f8e524d2f71ff55bbf2a25306753 (patch) | |
tree | ce51b9a9501bc006e8f11086924b61ddb31a6af4 /Lib | |
parent | 8488b85c6397fe58f17fc00e047044c959ac0b04 (diff) | |
download | cpython-22e7effad571f8e524d2f71ff55bbf2a25306753.zip cpython-22e7effad571f8e524d2f71ff55bbf2a25306753.tar.gz cpython-22e7effad571f8e524d2f71ff55bbf2a25306753.tar.bz2 |
bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_asynchat.py | 8 | ||||
-rw-r--r-- | Lib/test/test_asyncore.py | 6 | ||||
-rw-r--r-- | Lib/test/test_ftplib.py | 9 | ||||
-rw-r--r-- | Lib/test/test_logging.py | 7 | ||||
-rw-r--r-- | Lib/test/test_os.py | 7 | ||||
-rw-r--r-- | Lib/test/test_poplib.py | 8 | ||||
-rw-r--r-- | Lib/test/test_smtpd.py | 8 | ||||
-rw-r--r-- | Lib/test/test_smtplib.py | 8 | ||||
-rw-r--r-- | Lib/test/test_ssl.py | 6 |
9 files changed, 51 insertions, 16 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index b32eddd..973ac1f 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -4,8 +4,6 @@ from test import support from test.support import socket_helper from test.support import threading_helper -import asynchat -import asyncore import errno import socket import sys @@ -14,6 +12,12 @@ import time import unittest import unittest.mock +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asynchat + import asyncore + HOST = socket_helper.HOST SERVER_QUIT = b'QUIT\n' diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 3bd904d..ecd1e12 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -1,4 +1,3 @@ -import asyncore import unittest import select import os @@ -19,6 +18,11 @@ from io import BytesIO if support.PGO: raise unittest.SkipTest("test is not helpful for PGO") +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asyncore + HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX') diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index a48b429..3492ba4 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -4,8 +4,6 @@ # environment import ftplib -import asyncore -import asynchat import socket import io import errno @@ -24,6 +22,13 @@ from test.support import socket_helper from test.support import warnings_helper from test.support.socket_helper import HOST, HOSTv6 +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asyncore + import asynchat + + TIMEOUT = support.LOOPBACK_TIMEOUT DEFAULT_ENCODING = 'utf-8' # the dummy data returned by server over the data channel when diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 6d11190..48ed2eb 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -54,13 +54,16 @@ import unittest import warnings import weakref -import asyncore from http.server import HTTPServer, BaseHTTPRequestHandler -import smtpd from urllib.parse import urlparse, parse_qs from socketserver import (ThreadingUDPServer, DatagramRequestHandler, ThreadingTCPServer, StreamRequestHandler) +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asyncore + import smtpd + try: import win32evtlog, win32evtlogutil, pywintypes except ImportError: diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 8b3d1fe..684e308 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2,8 +2,6 @@ # does add tests for a few functions which have been determined to be more # portable than they had been thought to be. -import asynchat -import asyncore import codecs import contextlib import decimal @@ -39,6 +37,11 @@ from test.support import threading_helper from test.support import warnings_helper from platform import win32_is_iot +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asynchat + import asyncore + try: import resource except ImportError: diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index c5ae9f7..8dd6ea6 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -4,8 +4,6 @@ # a real test suite import poplib -import asyncore -import asynchat import socket import os import errno @@ -17,6 +15,12 @@ from test.support import hashlib_helper from test.support import socket_helper from test.support import threading_helper +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asynchat + import asyncore + HOST = socket_helper.HOST PORT = 0 diff --git a/Lib/test/test_smtpd.py b/Lib/test/test_smtpd.py index 6303192..d2e150d 100644 --- a/Lib/test/test_smtpd.py +++ b/Lib/test/test_smtpd.py @@ -5,8 +5,12 @@ from test.support import socket_helper from test.support import warnings_helper import socket import io -import smtpd -import asyncore + +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import smtpd + import asyncore class DummyServer(smtpd.SMTPServer): diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index f3d33ab..483d747 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -1,4 +1,3 @@ -import asyncore import base64 import email.mime.text from email.message import EmailMessage @@ -7,7 +6,6 @@ import email.utils import hashlib import hmac import socket -import smtpd import smtplib import io import re @@ -25,6 +23,12 @@ from test.support import socket_helper from test.support import threading_helper from unittest.mock import Mock +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asyncore + import smtpd + HOST = socket_helper.HOST if sys.platform == 'darwin': diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 11f4c3c..0cd3fb4 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -21,7 +21,6 @@ import pprint import urllib.request import threading import traceback -import asyncore import weakref import platform import sysconfig @@ -31,6 +30,11 @@ try: except ImportError: ctypes = None +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asyncore + ssl = import_helper.import_module("ssl") import _ssl |