[Python-checkins] bpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH-4387)
xdegaye
webhook-mailer at python.org
Sat Nov 18 12:10:56 EST 2017
https://github.com/python/cpython/commit/9001d1f438e968f4d327313e0a95a49f22e724f4
commit: 9001d1f438e968f4d327313e0a95a49f22e724f4
branch: master
author: xdegaye <xdegaye at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-11-18T18:10:53+01:00
summary:
bpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH-4387)
files:
M Lib/test/test_socketserver.py
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index a23373fbdf3..6584ba5ba86 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -60,10 +60,14 @@ def simple_subprocess(testcase):
if pid == 0:
# Don't raise an exception; it would be caught by the test harness.
os._exit(72)
- yield None
- pid2, status = os.waitpid(pid, 0)
- testcase.assertEqual(pid2, pid)
- testcase.assertEqual(72 << 8, status)
+ try:
+ yield None
+ except:
+ raise
+ finally:
+ pid2, status = os.waitpid(pid, 0)
+ testcase.assertEqual(pid2, pid)
+ testcase.assertEqual(72 << 8, status)
class SocketServerTest(unittest.TestCase):
@@ -108,7 +112,12 @@ def handle(self):
self.wfile.write(line)
if verbose: print("creating server")
- server = MyServer(addr, MyHandler)
+ try:
+ server = MyServer(addr, MyHandler)
+ except PermissionError as e:
+ # Issue 29184: cannot bind() a Unix socket on Android.
+ self.skipTest('Cannot create server (%s, %s): %s' %
+ (svrcls, addr, e))
self.assertEqual(server.server_address, server.socket.getsockname())
return server
More information about the Python-checkins
mailing list