]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-108303: Move `smtpd` to `test.support` (GH-114368) (#114427)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Jan 2024 14:08:31 +0000 (15:08 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Jan 2024 14:08:31 +0000 (14:08 +0000)
gh-108303: Move `smtpd` to `test.support` (GH-114368)

Update test_logging.py and test_smtplib.py.
(cherry picked from commit 8f5e7d739f56a75022dfe8fa24675b6c7b321ab5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/support/smtpd.py [moved from Lib/test/smtpd.py with 100% similarity]
Lib/test/test_logging.py
Lib/test/test_smtplib.py

similarity index 100%
rename from Lib/test/smtpd.py
rename to Lib/test/support/smtpd.py
index 635dd7c26f6eeda67dc372754a241e73e060aebe..d1ec2d6cf7a7d25f33eab126e575d12fe796cd2b 100644 (file)
@@ -49,6 +49,7 @@ from test.support import socket_helper
 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 urllib.parse import urlparse, parse_qs
 from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
                           ThreadingTCPServer, StreamRequestHandler)
 
-with warnings.catch_warnings():
-    from . import smtpd
-
 try:
     import win32evtlog, win32evtlogutil, pywintypes
 except ImportError:
index b6d5b8c3d82580ebc02a74721ae9bf32b9cf2378..4d8e1438deb0f542ab7e46237746dd4165065776 100644 (file)
@@ -22,10 +22,9 @@ from test.support import hashlib_helper
 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)