Only test abstract UNIX sockets on Linux

Abstract sockets are a Linux-only feature, binding to one on macOS fails
with ENOENT.
This commit is contained in:
Kovid Goyal 2026-11-07 16:10:19 +05:30
parent 03e24d85c7
commit 02f0f6ec00
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -4,6 +4,7 @@
import json
import os
import subprocess
import sys
import tempfile
from types import MethodType
from typing import Any, cast
@ -75,11 +76,13 @@ class TestRemoteControl(BaseTest):
with self.assertRaisesRegex(OSError, 'not a socket'):
listen(f'unix:{fpath}')
self.assertTrue(os.path.exists(fpath))
# Abstract sockets have no file and are unaffected
name = f'@kitty-test-listen-{os.getpid()}'
listen(f'unix:{name}')
with self.assertRaises(OSError):
if sys.platform.startswith('linux'):
# Abstract sockets have no file and are unaffected. They
# are only supported on Linux.
name = f'@kitty-test-listen-{os.getpid()}'
listen(f'unix:{name}')
with self.assertRaises(OSError):
listen(f'unix:{name}')
finally:
for close in closers:
close()