diff options
author | xdegaye <xdegaye@gmail.com> | 2019-05-03 15:09:17 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-03 15:09:17 (GMT) |
commit | 4461d704e23a13dfbe78ea3020e4cbeff4b68dc2 (patch) | |
tree | c1747fb1ab5906ff40a41308d9221f0d39139bd2 /Lib/test/test_stat.py | |
parent | a8a79cacca4a03e2e682bf10108c80f502791755 (diff) | |
download | cpython-4461d704e23a13dfbe78ea3020e4cbeff4b68dc2.zip cpython-4461d704e23a13dfbe78ea3020e4cbeff4b68dc2.tar.gz cpython-4461d704e23a13dfbe78ea3020e4cbeff4b68dc2.tar.bz2 |
bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399)
Those tests may fail with PermissionError.
https://bugs.python.org/issue36341
Diffstat (limited to 'Lib/test/test_stat.py')
-rw-r--r-- | Lib/test/test_stat.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py index 38ff2bc..17443be 100644 --- a/Lib/test/test_stat.py +++ b/Lib/test/test_stat.py @@ -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) |