def test_disable_default_socket_options(
        self, socket_options: list[int] | None
    ) -> None:
        """Test that passing None or empty list disables all socket options."""
        # This test needs to be here in order to be run. socket.create_connection actually tries
        # to connect to the host provided so we need a dummyserver to be running.
        with HTTPConnectionPool(
            self.host, self.port, socket_options=socket_options
        ) as pool:
            s = pool._new_conn()._new_conn()  # type: ignore[attr-defined]
            try:
                using_nagle = s.getsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY) == 0
                assert using_nagle
            finally:
                s.close()
Test that passing None or empty list disables all socket options.
test/with_dummyserver/test_connectionpool.py