From 8bec9fb92f09d02c24611ebd0a90103a1a414a40 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 24 Jun 2021 16:38:01 -0700 Subject: 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> --- Lib/test/test_asynchat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_asynchat.py') diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index b32edddc7d..973ac1f7d9 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -4,8 +4,6 @@ from test import support from test.support import socket_helper from test.support import threading_helper -import asynchat -import asyncore import errno import socket import sys @@ -14,6 +12,12 @@ import time import unittest import unittest.mock +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + import asynchat + import asyncore + HOST = socket_helper.HOST SERVER_QUIT = b'QUIT\n' -- cgit v1.2.1