From b554d697b8c37eaa137478218b43216a5174cbf8 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 22 Jan 2024 16:36:29 +0300 Subject: [PATCH] gh-108303: Move `smtpd` to `test.support` (#114368) Update test_logging.py and test_smtplib.py. --- Lib/test/{ => support}/smtpd.py | 0 Lib/test/test_logging.py | 4 +--- Lib/test/test_smtplib.py | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) rename Lib/test/{ => support}/smtpd.py (100%) diff --git a/Lib/test/smtpd.py b/Lib/test/support/smtpd.py similarity index 100% rename from Lib/test/smtpd.py rename to Lib/test/support/smtpd.py diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 0be269811842138..908e242b85f5e7a 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -49,6 +49,7 @@ from test.support import threading_helper from test.support import warnings_helper from test.support import asyncore +from test.support import smtpd from test.support.logging_helper import TestHandler import textwrap import threading @@ -63,9 +64,6 @@ from socketserver import (ThreadingUDPServer, DatagramRequestHandler, ThreadingTCPServer, StreamRequestHandler) -with warnings.catch_warnings(): - from . import smtpd - try: import win32evtlog, win32evtlogutil, pywintypes except ImportError: diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index f2e02dab1c3ca53..4c9fc14bd43f548 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -22,10 +22,9 @@ from test.support import socket_helper from test.support import threading_helper from test.support import asyncore +from test.support import smtpd from unittest.mock import Mock -from . import smtpd - support.requires_working_socket(module=True)