aboutsummaryrefslogtreecommitdiffstats
path: root/test/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/conftest.py')
-rw-r--r--test/conftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/conftest.py b/test/conftest.py
new file mode 100644
index 00000000..3d129ecf
--- /dev/null
+++ b/test/conftest.py
@@ -0,0 +1,14 @@
+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)