mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
exclude tests if no alpn support present
This commit is contained in:
parent
4501c8a0a1
commit
bfc7d3967c
@ -2,6 +2,8 @@ from __future__ import (absolute_import, print_function, division)
|
|||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import socket
|
import socket
|
||||||
|
import OpenSSL
|
||||||
|
import pytest
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@ -15,6 +17,11 @@ import h2
|
|||||||
from libmproxy import utils
|
from libmproxy import utils
|
||||||
from . import tservers
|
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):
|
class SimpleHttp2Server(netlib_tservers.ServerTestBase):
|
||||||
ssl = dict(
|
ssl = dict(
|
||||||
alpn_select=b'h2',
|
alpn_select=b'h2',
|
||||||
@ -49,6 +56,7 @@ class SimpleHttp2Server(netlib_tservers.ServerTestBase):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@requires_alpn
|
||||||
class TestHttp2(tservers.ProxTestBase):
|
class TestHttp2(tservers.ProxTestBase):
|
||||||
def _setup_connection(self):
|
def _setup_connection(self):
|
||||||
self.config.http2 = True
|
self.config.http2 = True
|
||||||
|
Loading…
Reference in New Issue
Block a user