summaryrefslogtreecommitdiff
path: root/Lib/test/test_socketserver.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-03 11:55:32 +0200
committerBerker Peksag <berker.peksag@gmail.com>2015-02-03 11:55:32 +0200
commit50457403f2a86769f378b6a57f6f4ed0c7b9cc39 (patch)
tree9e4ee72cff225e96003b55f4d254dbe2bdd7f457 /Lib/test/test_socketserver.py
parent87d0b45485e1042b0eae8aedf98fa3ebb29846b8 (diff)
parent3265344a85a2bac749230c2d6ef1b20edcd63906 (diff)
downloadcpython-git-50457403f2a86769f378b6a57f6f4ed0c7b9cc39.tar.gz
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 f5d8d524ac..31ab3b64f5 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
@@ -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()