Skip to content

Commit

Permalink
[PR #9728/78fcb2cc backport][3.10] Fixes issues with test_web_urldisp…
Browse files Browse the repository at this point in the history
…atcher when it encounters OS AF_UNIX too long (#9730)
  • Loading branch information
patchback[bot] authored Nov 9, 2024
1 parent edc0c07 commit 821300b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,15 @@ async def test_access_compressed_file_as_symlink(


async def test_access_special_resource(
tmp_path_factory: pytest.TempPathFactory, aiohttp_client: AiohttpClient
unix_sockname: str, aiohttp_client: AiohttpClient
) -> None:
"""Test access to non-regular files is forbidden using a UNIX domain socket."""
if not getattr(socket, "AF_UNIX", None):
pytest.skip("UNIX domain sockets not supported")

tmp_path = tmp_path_factory.mktemp("special")
my_special = tmp_path / "sock"
my_special = pathlib.Path(unix_sockname)
tmp_path = my_special.parent

my_socket = socket.socket(socket.AF_UNIX)
my_socket.bind(str(my_special))
assert my_special.is_socket()
Expand Down

0 comments on commit 821300b

Please sign in to comment.