mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399)
Those tests may fail with PermissionError. https://bugs.python.org/issue36341
This commit is contained in:
parent
a8a79cacca
commit
4461d704e2
4 changed files with 13 additions and 5 deletions
|
@ -2,7 +2,8 @@ import unittest
|
|||
import os
|
||||
import socket
|
||||
import sys
|
||||
from test.support import TESTFN, import_fresh_module
|
||||
from test.support import (TESTFN, import_fresh_module,
|
||||
skip_unless_bind_unix_socket)
|
||||
|
||||
c_stat = import_fresh_module('stat', fresh=['_stat'])
|
||||
py_stat = import_fresh_module('stat', blocked=['_stat'])
|
||||
|
@ -192,7 +193,7 @@ class TestFilemode:
|
|||
self.assertS_IS("BLK", st_mode)
|
||||
break
|
||||
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'requires unix socket')
|
||||
@skip_unless_bind_unix_socket
|
||||
def test_socket(self):
|
||||
with socket.socket(socket.AF_UNIX) as s:
|
||||
s.bind(TESTFN)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue