mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)
Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).
(cherry picked from commit a52a350977)
This commit is contained in:
parent
1f115a8822
commit
1ebe014d62
7 changed files with 80 additions and 1 deletions
|
|
@ -5171,6 +5171,7 @@ def mocked_socket_module(self):
|
|||
finally:
|
||||
socket.socket = old_socket
|
||||
|
||||
@socket_helper.skip_if_tcp_blackhole
|
||||
def test_connect(self):
|
||||
port = socket_helper.find_unused_port()
|
||||
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
|
@ -5179,6 +5180,7 @@ def test_connect(self):
|
|||
cli.connect((HOST, port))
|
||||
self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
|
||||
|
||||
@socket_helper.skip_if_tcp_blackhole
|
||||
def test_create_connection(self):
|
||||
# Issue #9792: errors raised by create_connection() should have
|
||||
# a proper errno attribute.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue