summaryrefslogtreecommitdiff
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 8f96fe48a3..23d22a8695 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -982,6 +982,23 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
def _testInitNonBlocking(self):
pass
+ def testInheritFlags(self):
+ # Issue #7995: when calling accept() on a listening socket with a
+ # timeout, the resulting socket should not be non-blocking.
+ self.serv.settimeout(10)
+ try:
+ conn, addr = self.serv.accept()
+ message = conn.recv(len(MSG))
+ finally:
+ conn.close()
+ self.serv.settimeout(None)
+
+ def _testInheritFlags(self):
+ time.sleep(0.1)
+ self.cli.connect((HOST, self.port))
+ time.sleep(0.5)
+ self.cli.send(MSG)
+
def testAccept(self):
# Testing non-blocking accept
self.serv.setblocking(0)