mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #23358: Add missing BaseServer entry to socketserver.__all__.
Patch by Martin Panter.
This commit is contained in:
commit
50457403f2
2 changed files with 16 additions and 11 deletions
|
|
@ -2,7 +2,6 @@
|
|||
Test suite for socketserver.
|
||||
"""
|
||||
|
||||
import _imp as imp
|
||||
import contextlib
|
||||
import os
|
||||
import select
|
||||
|
|
@ -281,12 +280,18 @@ class SocketServerTest(unittest.TestCase):
|
|||
socketserver.StreamRequestHandler)
|
||||
|
||||
|
||||
def test_main():
|
||||
if imp.lock_held():
|
||||
# If the import lock is held, the threads will hang
|
||||
raise unittest.SkipTest("can't run when import lock is held")
|
||||
class MiscTestCase(unittest.TestCase):
|
||||
|
||||
def test_all(self):
|
||||
# objects defined in the module should be in __all__
|
||||
expected = []
|
||||
for name in dir(socketserver):
|
||||
if not name.startswith('_'):
|
||||
mod_object = getattr(socketserver, name)
|
||||
if getattr(mod_object, '__module__', None) == 'socketserver':
|
||||
expected.append(name)
|
||||
self.assertCountEqual(socketserver.__all__, expected)
|
||||
|
||||
test.support.run_unittest(SocketServerTest)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue