From 4522f15c890e89f7a1ace243b2c1cbbaf76c5671 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 20 Oct 2017 13:37:26 +0200 Subject: skip ipv6 tests on sudo-enabled travis builds --- test/conftest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index b0842bc3..27918cf9 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -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' +) -- cgit v1.2.3