mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
15 lines
364 B
Python
15 lines
364 B
Python
|
import pytest
|
||
|
import OpenSSL
|
||
|
import mitmproxy.net.tcp
|
||
|
|
||
|
|
||
|
requires_alpn = pytest.mark.skipif(
|
||
|
not mitmproxy.net.tcp.HAS_ALPN,
|
||
|
reason='requires OpenSSL with ALPN support')
|
||
|
|
||
|
|
||
|
@pytest.fixture()
|
||
|
def disable_alpn(monkeypatch):
|
||
|
monkeypatch.setattr(mitmproxy.net.tcp, 'HAS_ALPN', False)
|
||
|
monkeypatch.setattr(OpenSSL.SSL._lib, 'Cryptography_HAS_ALPN', False)
|