summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socketserver.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-03 09:55:09 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-02-03 09:55:09 (GMT)
commit3265344a85a2bac749230c2d6ef1b20edcd63906 (patch)
tree4664ae622f2d7953438299f461cf3f72965fe633 /Lib/test/test_socketserver.py
parentc057c3859c68f2e86c7a492ae8f8b4b3a3b136c8 (diff)
downloadcpython-3265344a85a2bac749230c2d6ef1b20edcd63906.zip
cpython-3265344a85a2bac749230c2d6ef1b20edcd63906.tar.gz
cpython-3265344a85a2bac749230c2d6ef1b20edcd63906.tar.bz2
Issue #23358: Add missing BaseServer entry to socketserver.__all__.
Patch by Martin Panter.
Diffstat (limited to 'Lib/test/test_socketserver.py')
-rw-r--r--Lib/test/test_socketserver.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 0276f99..924b9c4 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -2,7 +2,6 @@
Test suite for socketserver.
"""
-import _imp as imp
import contextlib
import os
import select
@@ -313,12 +312,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()