MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_connect_ex_error

Method test_connect_ex_error

Lib/test/test_ssl.py:885–899  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

883 self.cert_time_fail(local_february_name() + " 9 00:00:00 2007 GMT")
884
885 def test_connect_ex_error(self):
886 server = socket.socket(socket.AF_INET)
887 self.addCleanup(server.close)
888 port = socket_helper.bind_port(server) # Reserve port but don't listen
889 s = test_wrap_socket(socket.socket(socket.AF_INET),
890 cert_reqs=ssl.CERT_REQUIRED)
891 self.addCleanup(s.close)
892 rc = s.connect_ex((HOST, port))
893 # Issue #19919: Windows machines or VMs hosted on Windows
894 # machines sometimes return EWOULDBLOCK.
895 errors = (
896 errno.ECONNREFUSED, errno.EHOSTUNREACH, errno.ETIMEDOUT,
897 errno.EWOULDBLOCK,
898 )
899 self.assertIn(rc, errors)
900
901 def test_read_write_zero(self):
902 # empty reads and writes now work, bpo-42854, bpo-31711

Callers

nothing calls this directly

Calls 5

test_wrap_socketFunction · 0.85
socketMethod · 0.80
addCleanupMethod · 0.80
assertInMethod · 0.80
connect_exMethod · 0.45

Tested by

no test coverage detected