2017-01-23 21:53:56 +00:00
|
|
|
import os
|
2017-10-20 11:37:26 +00:00
|
|
|
import socket
|
|
|
|
|
2020-12-11 12:47:47 +00:00
|
|
|
from mitmproxy.utils import data, compat
|
2018-04-22 23:05:58 +00:00
|
|
|
|
2016-12-01 09:36:18 +00:00
|
|
|
import pytest
|
|
|
|
|
2017-02-14 23:27:14 +00:00
|
|
|
pytest_plugins = ('test.full_coverage_plugin',)
|
2016-12-01 09:36:18 +00:00
|
|
|
|
2017-02-01 15:17:22 +00:00
|
|
|
skip_windows = pytest.mark.skipif(
|
|
|
|
os.name == "nt",
|
|
|
|
reason='Skipping due to Windows'
|
|
|
|
)
|
|
|
|
|
|
|
|
skip_not_windows = pytest.mark.skipif(
|
|
|
|
os.name != "nt",
|
|
|
|
reason='Skipping due to not Windows'
|
|
|
|
)
|
|
|
|
|
|
|
|
skip_appveyor = pytest.mark.skipif(
|
|
|
|
"APPVEYOR" in os.environ,
|
|
|
|
reason='Skipping due to Appveyor'
|
|
|
|
)
|
2017-10-20 11:37:26 +00:00
|
|
|
|
2020-12-11 12:47:47 +00:00
|
|
|
skip_new_proxy_core = pytest.mark.skipif(
|
|
|
|
compat.new_proxy_core,
|
|
|
|
reason='Skipping legacy test for old proxy core'
|
|
|
|
)
|
|
|
|
|
2017-10-20 11:37:26 +00:00
|
|
|
try:
|
|
|
|
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
|
|
|
s.bind(("::1", 0))
|
|
|
|
s.close()
|
|
|
|
except OSError:
|
|
|
|
no_ipv6 = True
|
|
|
|
else:
|
|
|
|
no_ipv6 = False
|
|
|
|
|
|
|
|
skip_no_ipv6 = pytest.mark.skipif(
|
|
|
|
no_ipv6,
|
|
|
|
reason='Host has no IPv6 support'
|
|
|
|
)
|
2018-04-22 23:05:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def tdata():
|
|
|
|
return data.Data(__name__)
|