Skip to content

Commit b188b54

Browse files
[PR #9728/78fcb2cc backport][3.11] Fixes issues with test_web_urldispatcher when it encounters OS AF_UNIX too long (#9731)
1 parent 79ab3a4 commit b188b54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_web_urldispatcher.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,15 @@ async def test_access_compressed_file_as_symlink(
553553

554554

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

562-
tmp_path = tmp_path_factory.mktemp("special")
563-
my_special = tmp_path / "sock"
562+
my_special = pathlib.Path(unix_sockname)
563+
tmp_path = my_special.parent
564+
564565
my_socket = socket.socket(socket.AF_UNIX)
565566
my_socket.bind(str(my_special))
566567
assert my_special.is_socket()

0 commit comments

Comments
 (0)