summaryrefslogtreecommitdiff
path: root/Lib/test/test_smtplib.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-24 16:38:01 -0700
committerGitHub <noreply@github.com>2021-06-25 00:38:01 +0100
commit8bec9fb92f09d02c24611ebd0a90103a1a414a40 (patch)
tree7fbbc8b020e80966714e9d75885255d1442d5db4 /Lib/test/test_smtplib.py
parenta80a38ee9a7b2e26dba848793cc298d8435fddd5 (diff)
downloadcpython-git-8bec9fb92f09d02c24611ebd0a90103a1a414a40.tar.gz
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>
Diffstat (limited to 'Lib/test/test_smtplib.py')
-rw-r--r--Lib/test/test_smtplib.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index f3d33ab077..483d747ee6 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':