skip ipv6 tests on sudo-enabled travis builds
This commit is contained in:
parent
bf67c734ea
commit
4522f15c89
|
@ -1,4 +1,6 @@
|
|||
import os
|
||||
import socket
|
||||
|
||||
import pytest
|
||||
|
||||
pytest_plugins = ('test.full_coverage_plugin',)
|
||||
|
@ -17,3 +19,17 @@ skip_appveyor = pytest.mark.skipif(
|
|||
"APPVEYOR" in os.environ,
|
||||
reason='Skipping due to Appveyor'
|
||||
)
|
||||
|
||||
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'
|
||||
)
|
||||
|
|
|
@ -12,6 +12,7 @@ from mitmproxy import certs
|
|||
from mitmproxy.net import tcp
|
||||
from mitmproxy import exceptions
|
||||
from mitmproxy.test import tutils
|
||||
from ...conftest import skip_no_ipv6
|
||||
|
||||
from . import tservers
|
||||
|
||||
|
@ -112,6 +113,7 @@ class TestServerBind(tservers.ServerTestBase):
|
|||
pass
|
||||
|
||||
|
||||
@skip_no_ipv6
|
||||
class TestServerIPv6(tservers.ServerTestBase):
|
||||
handler = EchoHandler
|
||||
addr = ("::1", 0)
|
||||
|
|
Loading…
Reference in New Issue