bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905) (GH-26907)

(cherry picked from commit 22e7effad571f8e524d2f71ff55bbf2a25306753)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index a89768f..fab382f 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -21,7 +21,6 @@
 import urllib.request
 import threading
 import traceback
-import asyncore
 import weakref
 import platform
 import sysconfig
@@ -31,6 +30,11 @@
 except ImportError:
     ctypes = None
 
+import warnings
+with warnings.catch_warnings():
+    warnings.simplefilter('ignore', DeprecationWarning)
+    import asyncore
+
 ssl = import_helper.import_module("ssl")
 import _ssl