summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorShane Harvey <shnhrv@gmail.com>2021-07-14 22:53:15 (GMT)
committerGitHub <noreply@github.com>2021-07-14 22:53:15 (GMT)
commitd59d7374a364c4e5c2b9a83d8e4543ee494285b8 (patch)
treee53a89ab474d7671bd0e21fda5801bb4eda641de /Lib/test/test_socket.py
parent2b47af63982e4ccc09ae14c7c66ba115804bbbf6 (diff)
downloadcpython-d59d7374a364c4e5c2b9a83d8e4543ee494285b8.zip
cpython-d59d7374a364c4e5c2b9a83d8e4543ee494285b8.tar.gz
cpython-d59d7374a364c4e5c2b9a83d8e4543ee494285b8.tar.bz2
bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)
Diffstat (limited to 'Lib/test/test_socket.py')
-rwxr-xr-xLib/test/test_socket.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 828d1f3..c09f11e 100755
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -6446,6 +6446,12 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
sock.bind(("type", "n" * 64))
+@unittest.skipUnless(sys.platform == 'darwin', 'macOS specific test')
+class TestMacOSTCPFlags(unittest.TestCase):
+ def test_tcp_keepalive(self):
+ self.assertTrue(socket.TCP_KEEPALIVE)
+
+
@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
class TestMSWindowsTCPFlags(unittest.TestCase):
knownTCPFlags = {
@@ -6704,6 +6710,7 @@ def test_main():
SendfileUsingSendfileTest,
])
tests.append(TestMSWindowsTCPFlags)
+ tests.append(TestMacOSTCPFlags)
thread_info = threading_helper.threading_setup()
support.run_unittest(*tests)