From: Christian Heimes Date: Tue, 6 Sep 2016 09:14:09 +0000 (+0200) Subject: Issue 27744: skip test if AF_ALG socket bind fails X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=407380f63f9f831e0cd445ba8527d3d195f478ed;p=python Issue 27744: skip test if AF_ALG socket bind fails --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 71837143c5..b3632e9af9 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5343,7 +5343,11 @@ class LinuxKernelCryptoAPI(unittest.TestCase): # tests for AF_ALG def create_alg(self, typ, name): sock = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0) - sock.bind((typ, name)) + try: + sock.bind((typ, name)) + except FileNotFoundError as e: + # type / algorithm is not available + raise unittest.SkipTest(str(e), typ, name) return sock def test_sha256(self):