mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905)
This commit is contained in:
parent
8488b85c63
commit
22e7effad5
9 changed files with 51 additions and 16 deletions
|
@ -4,8 +4,6 @@ from test import support
|
||||||
from test.support import socket_helper
|
from test.support import socket_helper
|
||||||
from test.support import threading_helper
|
from test.support import threading_helper
|
||||||
|
|
||||||
import asynchat
|
|
||||||
import asyncore
|
|
||||||
import errno
|
import errno
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
|
@ -14,6 +12,12 @@ import time
|
||||||
import unittest
|
import unittest
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import asynchat
|
||||||
|
import asyncore
|
||||||
|
|
||||||
HOST = socket_helper.HOST
|
HOST = socket_helper.HOST
|
||||||
SERVER_QUIT = b'QUIT\n'
|
SERVER_QUIT = b'QUIT\n'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import asyncore
|
|
||||||
import unittest
|
import unittest
|
||||||
import select
|
import select
|
||||||
import os
|
import os
|
||||||
|
@ -19,6 +18,11 @@ from io import BytesIO
|
||||||
if support.PGO:
|
if support.PGO:
|
||||||
raise unittest.SkipTest("test is not helpful for 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')
|
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# environment
|
# environment
|
||||||
|
|
||||||
import ftplib
|
import ftplib
|
||||||
import asyncore
|
|
||||||
import asynchat
|
|
||||||
import socket
|
import socket
|
||||||
import io
|
import io
|
||||||
import errno
|
import errno
|
||||||
|
@ -24,6 +22,13 @@ from test.support import socket_helper
|
||||||
from test.support import warnings_helper
|
from test.support import warnings_helper
|
||||||
from test.support.socket_helper import HOST, HOSTv6
|
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
|
TIMEOUT = support.LOOPBACK_TIMEOUT
|
||||||
DEFAULT_ENCODING = 'utf-8'
|
DEFAULT_ENCODING = 'utf-8'
|
||||||
# the dummy data returned by server over the data channel when
|
# the dummy data returned by server over the data channel when
|
||||||
|
|
|
@ -54,13 +54,16 @@ import unittest
|
||||||
import warnings
|
import warnings
|
||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
import asyncore
|
|
||||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||||
import smtpd
|
|
||||||
from urllib.parse import urlparse, parse_qs
|
from urllib.parse import urlparse, parse_qs
|
||||||
from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
|
from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
|
||||||
ThreadingTCPServer, StreamRequestHandler)
|
ThreadingTCPServer, StreamRequestHandler)
|
||||||
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import asyncore
|
||||||
|
import smtpd
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import win32evtlog, win32evtlogutil, pywintypes
|
import win32evtlog, win32evtlogutil, pywintypes
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
# does add tests for a few functions which have been determined to be more
|
# does add tests for a few functions which have been determined to be more
|
||||||
# portable than they had been thought to be.
|
# portable than they had been thought to be.
|
||||||
|
|
||||||
import asynchat
|
|
||||||
import asyncore
|
|
||||||
import codecs
|
import codecs
|
||||||
import contextlib
|
import contextlib
|
||||||
import decimal
|
import decimal
|
||||||
|
@ -39,6 +37,11 @@ from test.support import threading_helper
|
||||||
from test.support import warnings_helper
|
from test.support import warnings_helper
|
||||||
from platform import win32_is_iot
|
from platform import win32_is_iot
|
||||||
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import asynchat
|
||||||
|
import asyncore
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import resource
|
import resource
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# a real test suite
|
# a real test suite
|
||||||
|
|
||||||
import poplib
|
import poplib
|
||||||
import asyncore
|
|
||||||
import asynchat
|
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
import errno
|
import errno
|
||||||
|
@ -17,6 +15,12 @@ from test.support import hashlib_helper
|
||||||
from test.support import socket_helper
|
from test.support import socket_helper
|
||||||
from test.support import threading_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
|
HOST = socket_helper.HOST
|
||||||
PORT = 0
|
PORT = 0
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,12 @@ from test.support import socket_helper
|
||||||
from test.support import warnings_helper
|
from test.support import warnings_helper
|
||||||
import socket
|
import socket
|
||||||
import io
|
import io
|
||||||
import smtpd
|
|
||||||
import asyncore
|
import warnings
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import smtpd
|
||||||
|
import asyncore
|
||||||
|
|
||||||
|
|
||||||
class DummyServer(smtpd.SMTPServer):
|
class DummyServer(smtpd.SMTPServer):
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import asyncore
|
|
||||||
import base64
|
import base64
|
||||||
import email.mime.text
|
import email.mime.text
|
||||||
from email.message import EmailMessage
|
from email.message import EmailMessage
|
||||||
|
@ -7,7 +6,6 @@ import email.utils
|
||||||
import hashlib
|
import hashlib
|
||||||
import hmac
|
import hmac
|
||||||
import socket
|
import socket
|
||||||
import smtpd
|
|
||||||
import smtplib
|
import smtplib
|
||||||
import io
|
import io
|
||||||
import re
|
import re
|
||||||
|
@ -25,6 +23,12 @@ from test.support import socket_helper
|
||||||
from test.support import threading_helper
|
from test.support import threading_helper
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import asyncore
|
||||||
|
import smtpd
|
||||||
|
|
||||||
HOST = socket_helper.HOST
|
HOST = socket_helper.HOST
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
|
|
|
@ -21,7 +21,6 @@ import pprint
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
import asyncore
|
|
||||||
import weakref
|
import weakref
|
||||||
import platform
|
import platform
|
||||||
import sysconfig
|
import sysconfig
|
||||||
|
@ -31,6 +30,11 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
ctypes = None
|
ctypes = None
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter('ignore', DeprecationWarning)
|
||||||
|
import asyncore
|
||||||
|
|
||||||
ssl = import_helper.import_module("ssl")
|
ssl = import_helper.import_module("ssl")
|
||||||
import _ssl
|
import _ssl
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue