gh-92169: Use warnings_helper.import_deprecated() to import deprecated modules uniformly in tests (GH-92170)

This commit is contained in:
Hugo van Kemenade 2022-05-03 10:17:54 +03:00 committed by GitHub
parent c1767fce52
commit 9b027d4cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 33 additions and 41 deletions

View file

@ -15,12 +15,12 @@ from test import support as test_support
from test.support import hashlib_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
asynchat = warnings_helper.import_deprecated('asynchat')
asyncore = warnings_helper.import_deprecated('asyncore')
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
import asynchat
import asyncore
test_support.requires_working_socket(module=True)