mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-93852: Add test.support.create_unix_domain_name() (#93914)
test_asyncio, test_logging, test_socket and test_socketserver now create AF_UNIX domains in the current directory to no longer fail with OSError("AF_UNIX path too long") if the temporary directory (the TMPDIR environment variable) is too long. Modify the following tests to use create_unix_domain_name(): * test_asyncio * test_logging * test_socket * test_socketserver test_asyncio.utils: remove unused time import.
This commit is contained in:
parent
ffc228dd4e
commit
c5b750dc0b
7 changed files with 82 additions and 86 deletions
|
@ -11,9 +11,7 @@ import selectors
|
|||
import socket
|
||||
import socketserver
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import weakref
|
||||
|
||||
|
@ -34,6 +32,7 @@ from asyncio import futures
|
|||
from asyncio import tasks
|
||||
from asyncio.log import logger
|
||||
from test import support
|
||||
from test.support import socket_helper
|
||||
from test.support import threading_helper
|
||||
|
||||
|
||||
|
@ -251,8 +250,7 @@ if hasattr(socket, 'AF_UNIX'):
|
|||
|
||||
|
||||
def gen_unix_socket_path():
|
||||
with tempfile.NamedTemporaryFile() as file:
|
||||
return file.name
|
||||
return socket_helper.create_unix_domain_name()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue