mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
test_pydoc: skip PydocServerTest if thread support is disabled
This commit is contained in:
parent
4445ec81c1
commit
62a68f2dbe
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,11 @@ from test.support import TESTFN, forget, rmtree, EnvironmentVarGuard, \
|
||||||
|
|
||||||
from test import pydoc_mod
|
from test import pydoc_mod
|
||||||
|
|
||||||
|
try:
|
||||||
|
import threading
|
||||||
|
except ImportError:
|
||||||
|
threading = None
|
||||||
|
|
||||||
# Just in case sys.modules["test"] has the optional attribute __loader__.
|
# Just in case sys.modules["test"] has the optional attribute __loader__.
|
||||||
if hasattr(pydoc_mod, "__loader__"):
|
if hasattr(pydoc_mod, "__loader__"):
|
||||||
del pydoc_mod.__loader__
|
del pydoc_mod.__loader__
|
||||||
|
@ -403,6 +408,7 @@ class TestDescriptions(unittest.TestCase):
|
||||||
self.assertIn(expected, pydoc.render_doc(c))
|
self.assertIn(expected, pydoc.render_doc(c))
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||||
class PydocServerTest(unittest.TestCase):
|
class PydocServerTest(unittest.TestCase):
|
||||||
"""Tests for pydoc._start_server"""
|
"""Tests for pydoc._start_server"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue