From bfc7d3967c0978b22faeaedc653a695e65156b34 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Mon, 25 Jan 2016 19:09:14 +0100 Subject: [PATCH] exclude tests if no alpn support present --- test/test_protocol_http2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_protocol_http2.py b/test/test_protocol_http2.py index 17b8506d0..d3725e81b 100644 --- a/test/test_protocol_http2.py +++ b/test/test_protocol_http2.py @@ -2,6 +2,8 @@ from __future__ import (absolute_import, print_function, division) import inspect import socket +import OpenSSL +import pytest from io import BytesIO import logging @@ -15,6 +17,11 @@ import h2 from libmproxy import utils from . import tservers +requires_alpn = pytest.mark.skipif( + not OpenSSL._util.lib.Cryptography_HAS_ALPN, + reason="requires OpenSSL with ALPN support") + + class SimpleHttp2Server(netlib_tservers.ServerTestBase): ssl = dict( alpn_select=b'h2', @@ -49,6 +56,7 @@ class SimpleHttp2Server(netlib_tservers.ServerTestBase): return +@requires_alpn class TestHttp2(tservers.ProxTestBase): def _setup_connection(self): self.config.http2 = True