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_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 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):