restore EAI_ADDRFAMILY after test
This commit is contained in:
parent
e4ee569bd2
commit
95d8c273c4
@ -110,9 +110,6 @@ class TestBaseServerRequests:
|
||||
def test_ipv6(self):
|
||||
if not server.HAS_IPV6:
|
||||
pytest.skip("IPv6 not supported")
|
||||
if os.name == "nt" and server.EAI_ADDRFAMILY is None:
|
||||
# HACK: incomplete errno conversion in WINE
|
||||
server.EAI_ADDRFAMILY = -9
|
||||
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock:
|
||||
sock.setsockopt(server.IPPROTO_IPV6, server.IPV6_V6ONLY, 1)
|
||||
try:
|
||||
@ -122,6 +119,13 @@ class TestBaseServerRequests:
|
||||
pytest.skip("IPv6 not supported")
|
||||
self.sockname = sock.getsockname()[:2]
|
||||
self.configuration["server"]["hosts"] = "[%s]:%d" % self.sockname
|
||||
savedEaiAddrfamily = server.EAI_ADDRFAMILY
|
||||
if os.name == "nt" and server.EAI_ADDRFAMILY is None:
|
||||
# HACK: incomplete errno conversion in WINE
|
||||
server.EAI_ADDRFAMILY = -9
|
||||
try:
|
||||
self.thread.start()
|
||||
status, _, _ = self.request("GET", "/")
|
||||
finally:
|
||||
server.EAI_ADDRFAMILY = savedEaiAddrfamily
|
||||
assert status == 302
|
||||
|
Loading…
Reference in New Issue
Block a user