mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +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.handlers
|
||||||
import logging.config
|
import logging.config
|
||||||
|
|
||||||
import asynchat
|
|
||||||
import asyncore
|
|
||||||
import codecs
|
import codecs
|
||||||
import datetime
|
import datetime
|
||||||
import errno
|
|
||||||
import pickle
|
import pickle
|
||||||
import io
|
import io
|
||||||
import gc
|
import gc
|
||||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import queue
|
import queue
|
||||||
import re
|
import re
|
||||||
import select
|
import select
|
||||||
import smtpd
|
|
||||||
import socket
|
import socket
|
||||||
from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
|
|
||||||
ThreadingTCPServer, StreamRequestHandler)
|
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
@ -51,11 +44,19 @@ from test.support import TestHandler, Matcher
|
||||||
import textwrap
|
import textwrap
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
from urllib.parse import urlparse, parse_qs
|
|
||||||
import warnings
|
import warnings
|
||||||
import weakref
|
import weakref
|
||||||
try:
|
try:
|
||||||
import threading
|
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:
|
except ImportError:
|
||||||
threading = None
|
threading = None
|
||||||
try:
|
try:
|
||||||
|
@ -611,6 +612,7 @@ class StreamHandlerTest(BaseTest):
|
||||||
# -- The following section could be moved into a server_helper.py module
|
# -- 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 it proves to be of wider utility than just test_logging
|
||||||
|
|
||||||
|
if threading:
|
||||||
class TestSMTPChannel(smtpd.SMTPChannel):
|
class TestSMTPChannel(smtpd.SMTPChannel):
|
||||||
"""
|
"""
|
||||||
This derived class has had to be created because smtpd does not
|
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
|
# - end of server_helper section
|
||||||
|
|
||||||
|
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||||
class SMTPHandlerTest(BaseTest):
|
class SMTPHandlerTest(BaseTest):
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
sockmap = {}
|
sockmap = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue