Skip to content

Question:document for how to do pytest  #108

@honglei

Description

@honglei

Env:CentOS8/ mosquitto 1.6.9

[root@localhost gmqtt-0.6.4]#  /opt/python38/bin/pytest
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.8.1, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /root/libs/gmqtt-0.6.4, inifile: pytest.ini
plugins: hypothesis-5.6.0, cov-2.8.1, forked-1.1.3, xdist-1.31.0, asyncio-0.11.0
collected 16 items

tests/test_mqtt5.py EEEEEEFEEEEEEEEE                                                                                                                                                    [100%]

=========================================================================================== ERRORS ============================================================================================
________________________________________________________________________________ ERROR at setup of test_basic _________________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_________________________________________________________________________ ERROR at setup of test_basic_subscriptions __________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
___________________________________________________________________________ ERROR at setup of test_retained_message ___________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_____________________________________________________________________________ ERROR at setup of test_will_message _____________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_________________________________________________________________ ERROR at setup of test_no_will_message_on_gentle_disconnect _________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_________________________________________________________________________ ERROR at setup of test_shared_subscriptions _________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_____________________________________________________________________________ ERROR at setup of test_unsubscribe ______________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
______________________________________________________________________ ERROR at setup of test_overlapping_subscriptions _______________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
_______________________________________________________________________ ERROR at setup of test_redelivery_on_reconnect ________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
___________________________________________________________________________ ERROR at setup of test_async_on_message ___________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection
    connection = await MQTTConnection.create_connection(host, port, ssl, clean_session, keepalive)
gmqtt/mqtt/connection.py:27: in create_connection
    transport, protocol = await loop.create_connection(MQTTProtocol, host, port, ssl=ssl)
/opt/python38/lib/python3.8/asyncio/base_events.py:1021: in create_connection
    raise exceptions[0]
/opt/python38/lib/python3.8/asyncio/base_events.py:1006: in create_connection
    sock = await self._connect_sock(
/opt/python38/lib/python3.8/asyncio/base_events.py:920: in _connect_sock
    await self.sock_connect(sock, address)
/opt/python38/lib/python3.8/asyncio/selector_events.py:494: in sock_connect
    return await fut
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_UnixSelectorEventLoop running=False closed=False debug=False>, fut = <Future finished exception=ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 1883)")>
sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, address = ('127.0.0.1', 1883)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
>               raise OSError(err, f'Connect call failed {address}')
E               ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 1883)

/opt/python38/lib/python3.8/asyncio/selector_events.py:526: ConnectionRefusedError
------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------
clean up starting
___________________________________________________________________________ ERROR at setup of test_request_response ___________________________________________________________________________

    @pytest.fixture()
    async def init_clients():
>       await cleanup(host, port, username, prefix=PREFIX)

tests/test_mqtt5.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:76: in cleanup
    await curclient.connect(host=host, port=port)
gmqtt/client.py:160: in connect
    self._connection = await self._create_connection(
gmqtt/client.py:177: in _create_connection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions