cpython: c83fb59b73ea (original) (raw)

--- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -25,24 +25,17 @@ import logging import logging.handlers import logging.config -import asynchat -import asyncore import codecs import datetime -import errno import pickle import io import gc -from http.server import HTTPServer, BaseHTTPRequestHandler import json import os import queue import re import select -import smtpd import socket -from socketserver import (ThreadingUDPServer, DatagramRequestHandler,

import struct import sys import tempfile @@ -51,11 +44,19 @@ from test.support import TestHandler, Ma import textwrap import time import unittest -from urllib.parse import urlparse, parse_qs import warnings import weakref try: import threading

except ImportError: threading = None try: @@ -611,284 +612,286 @@ class StreamHandlerTest(BaseTest):

-- The following section could be moved into a server_helper.py module

-- if it proves to be of wider utility than just test_logging

-class TestSMTPChannel(smtpd.SMTPChannel):

- - -class TestSMTPServer(smtpd.SMTPServer):

-

-

-

+if threading:

-

-

+ +

-

-

+

-

-

- -class ControlMixin(object):

-

-

-

-

-

+

+

+

+

+

+

+

+

- -class TestHTTPServer(ControlMixin, HTTPServer):

-

-

-

- -class TestTCPServer(ControlMixin, ThreadingTCPServer):

-

-

-

-

-

- -class TestUDPServer(ControlMixin, ThreadingUDPServer):

-

-

-

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

- end of server_helper section

+@unittest.skipUnless(threading, 'Threading required for this test.') class SMTPHandlerTest(BaseTest): def test_basic(self): sockmap = {}