Skip to content

Commit 11088e4

Browse files
rustyconoverclaude
andcommitted
fix(tests): silence Windows mypy on os.fork / socket.AF_UNIX
The fork-safety and Unix-socket tests are guarded by @pytest.mark.skipif(sys.platform == "win32"), but mypy still type-checks the bodies on Windows where neither attribute exists. Match the existing conftest pattern with `type: ignore[attr-defined, unused-ignore]`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 101c646 commit 11088e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_transport_kind.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def test_fork_after_make_wsgi_app(self) -> None:
366366

367367
# Use a pipe to confirm the child fired the hook in its own process.
368368
r_fd, w_fd = os.pipe()
369-
pid = os.fork()
369+
pid = os.fork() # type: ignore[attr-defined, unused-ignore]
370370
if pid == 0:
371371
# Child
372372
os.close(r_fd)
@@ -429,7 +429,7 @@ class TestUnixTransportRaw:
429429

430430
def test_isinstance_dispatch(self) -> None:
431431
"""A bare UnixTransport bound via serve() reports UNIX."""
432-
s1, s2 = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
432+
s1, s2 = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM) # type: ignore[attr-defined, unused-ignore]
433433
client_transport = UnixTransport(s1)
434434
server_transport = UnixTransport(s2)
435435
impl = _RecordingImpl()

0 commit comments

Comments
 (0)