Skip to content

Commit

Permalink
Fixes issues with test_web_urldispatcher when it encounters OS AF_UNI…
Browse files Browse the repository at this point in the history
…X too long (#9728)

Co-authored-by: Emmanuel Okedele <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 9, 2024
1 parent 4d448ae commit 78fcb2c
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 @@ -547,14 +547,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 78fcb2c

Please sign in to comment.