From: Debian Python Team Date: Thu, 20 Mar 2025 12:56:44 +0000 (+0100) Subject: _tests__silence_asyncore_smtpd_deprecation_warnings X-Git-Tag: archive/raspbian/6.3.2-1+rpi1+deb12u1^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8dcfd3bcc79aedef8f007e3ba9c138845e88c2d1;p=mercurial.git _tests__silence_asyncore_smtpd_deprecation_warnings # HG changeset patch # User Julien Cristau # Date 1649671433 -7200 # Mon Apr 11 12:03:53 2022 +0200 # Node ID d3df32e12246208fc8bb9507ff921099348c6783 # Parent 5005928cac60a43d98d88523713983efdc204d50 tests: silence asyncore/smtpd deprecation warnings Gbp-Pq: Topic py310 Gbp-Pq: Name 9_tests__silence_asyncore_smtpd_deprecation_warnings.patch --- diff --git a/tests/dummysmtpd.py b/tests/dummysmtpd.py index 565c4f5..6844467 100755 --- a/tests/dummysmtpd.py +++ b/tests/dummysmtpd.py @@ -3,12 +3,16 @@ """dummy SMTP server for use in tests""" -import asyncore import optparse -import smtpd import ssl import sys import traceback +import warnings + +with warnings.catch_warnings(): + warnings.filterwarnings('ignore', 'The (asyncore|smtpd) module is deprecated', DeprecationWarning) + import asyncore + import smtpd from mercurial import ( pycompat,