mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Skip some more tests in the absence of threading.
This commit is contained in:
parent
362ce37963
commit
ce7c978140
1 changed files with 251 additions and 248 deletions
|
@ -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,
|
||||
ThreadingTCPServer, StreamRequestHandler)
|
||||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -51,11 +44,19 @@ from test.support import TestHandler, Matcher
|
|||
import textwrap
|
||||
import time
|
||||
import unittest
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
import warnings
|
||||
import weakref
|
||||
try:
|
||||
import threading
|
||||
# The following imports are needed only for tests which
|
||||
import asynchat
|
||||
import asyncore
|
||||
import errno
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
import smtpd
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
|
||||
ThreadingTCPServer, StreamRequestHandler)
|
||||
except ImportError:
|
||||
threading = None
|
||||
try:
|
||||
|
@ -611,6 +612,7 @@ 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
|
||||
|
||||
if threading:
|
||||
class TestSMTPChannel(smtpd.SMTPChannel):
|
||||
"""
|
||||
This derived class has had to be created because smtpd does not
|
||||
|
@ -889,6 +891,7 @@ 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 = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue