Issue #12115: skipping all tests that need threading under a threadless environment

This commit is contained in:
Tarek Ziade 2011-05-19 15:26:59 +02:00
parent cfd365b937
commit fd88318ac4
4 changed files with 35 additions and 4 deletions

View file

@ -5,10 +5,18 @@ import urllib.request
import urllib.parse
import urllib.error
from packaging.tests.pypi_server import PyPIServer, PYPI_DEFAULT_STATIC_PATH
try:
import threading
from packaging.tests.pypi_server import PyPIServer, PYPI_DEFAULT_STATIC_PATH
except ImportError:
threading = None
PyPIServer = None
PYPI_DEFAULT_STATIC_PATH = None
from packaging.tests import unittest
@unittest.skipIf(threading is None, "Needs threading")
class PyPIServerTest(unittest.TestCase):
def test_records_requests(self):