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
|
@ -8,7 +8,6 @@ import os
|
|||
import select
|
||||
import signal
|
||||
import socket
|
||||
import tempfile
|
||||
import threading
|
||||
import unittest
|
||||
import socketserver
|
||||
|
@ -98,8 +97,7 @@ class SocketServerTest(unittest.TestCase):
|
|||
else:
|
||||
# XXX: We need a way to tell AF_UNIX to pick its own name
|
||||
# like AF_INET provides port==0.
|
||||
dir = None
|
||||
fn = tempfile.mktemp(prefix='unix_socket.', dir=dir)
|
||||
fn = socket_helper.create_unix_domain_name()
|
||||
self.test_files.append(fn)
|
||||
return fn
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue