Skip to content

Commit

Permalink
Replace AF_UNIX by AF_INET on subprocess test (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Nov 25, 2022
1 parent e8d5e62 commit 782f17e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/test_subprocess.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import socket
import sys
from typing import TYPE_CHECKING, List
from unittest.mock import patch

import pytest

from uvicorn._subprocess import SpawnProcess, get_subprocess, subprocess_started
from uvicorn.config import Config

Expand All @@ -22,9 +19,8 @@ async def app(
...


@pytest.mark.skipif(sys.platform == "win32", reason="require unix-like system")
def test_get_subprocess() -> None: # pragma: py-win32
fdsock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
def test_get_subprocess() -> None:
fdsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
fd = fdsock.fileno()
config = Config(app=app, fd=fd)
config.load()
Expand All @@ -35,9 +31,8 @@ def test_get_subprocess() -> None: # pragma: py-win32
fdsock.close()


@pytest.mark.skipif(sys.platform == "win32", reason="require unix-like system")
def test_subprocess_started() -> None: # pragma: py-win32
fdsock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
def test_subprocess_started() -> None:
fdsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
fd = fdsock.fileno()
config = Config(app=app, fd=fd)
config.load()
Expand Down

0 comments on commit 782f17e

Please sign in to comment.