Skip to content

Commit

Permalink
gh-74895: adjust tests to work on Solaris (#104326)
Browse files Browse the repository at this point in the history
Solaris is unusual here, but apparently everyone is happy when SOCK_STREAM is explicitly specified.
  • Loading branch information
kulikjak authored May 9, 2023
1 parent 235b827 commit 2c863b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ def test_getaddrinfo_int_port_overflow(self):

from _testcapi import ULONG_MAX, LONG_MAX, LONG_MIN
try:
socket.getaddrinfo(None, ULONG_MAX + 1)
socket.getaddrinfo(None, ULONG_MAX + 1, type=socket.SOCK_STREAM)
except OverflowError:
# Platforms differ as to what values consitute a getaddrinfo() error
# return. Some fail for LONG_MAX+1, others ULONG_MAX+1, and Windows
Expand All @@ -1632,28 +1632,28 @@ def test_getaddrinfo_int_port_overflow(self):
pass

try:
socket.getaddrinfo(None, LONG_MAX + 1)
socket.getaddrinfo(None, LONG_MAX + 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
pass

try:
socket.getaddrinfo(None, LONG_MAX - 0xffff + 1)
socket.getaddrinfo(None, LONG_MAX - 0xffff + 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
pass

try:
socket.getaddrinfo(None, LONG_MIN - 1)
socket.getaddrinfo(None, LONG_MIN - 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
pass

socket.getaddrinfo(None, 0) # No error expected.
socket.getaddrinfo(None, 0xffff) # No error expected.
socket.getaddrinfo(None, 0, type=socket.SOCK_STREAM) # No error expected.
socket.getaddrinfo(None, 0xffff, type=socket.SOCK_STREAM) # No error expected.

def test_getnameinfo(self):
# only IP addresses are allowed
Expand Down

0 comments on commit 2c863b3

Please sign in to comment.