def __init__(self, connection_address: str = 'demo.dxfeed.com:7300', connect: bool = True):
        """
        Parameters
        ----------
        connection_address: str
            One of possible connection addresses:

            - the single address: `host:port` or just `host`
            - address with credentials: `host:port[username=xxx,password=yyy]`
            - multiple addresses: `(host1:port1)(host2)(host3:port3[username=xxx,password=yyy])`

            Default: demo.dxfeed.com:7300
        connect: bool
            When True `connect` method  is called during instance creation. Default - True
        """
        self.__con_address = connection_address
        self.__connection = dxp.ConnectionClass()
        if connect:
            self.connect()
def test_weakref_fail_on_incorrect_type():
    con = dxc.ConnectionClass()
    obj = list()
    con.add_weakref(obj)
def test_weakref():
    con = dxc.ConnectionClass()
    sub = dxc.SubscriptionClass()
    con.add_weakref(sub)
    assert con.get_weakrefs()[0] is sub