Version 2.0 #317
59 tests run, 35 passed, 0 skipped, 24 failed.
Annotations
Check failure on line 49 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_unsubscribe
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_unsubscribe() -> None:
"""Test that messages are no longer received after unsubscribing from a topic."""
topic_1 = TOPIC_PREFIX + "test_client_unsubscribe/1"
topic_2 = TOPIC_PREFIX + "test_client_unsubscribe/2"
async def handle(tg: anyio.abc.TaskGroup) -> None:
is_first_message = True
async for message in client.messages:
if is_first_message:
assert message.topic.value == topic_1
is_first_message = False
else:
assert message.topic.value == topic_2
tg.cancel_scope.cancel()
> async with Client(HOSTNAME) as client, anyio.create_task_group() as tg:
tests/test_client.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0e5dc0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 66 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_id[ProtocolVersion.V31-22]
TypeError: 'type' object is not subscriptable
Raw output
protocol = <ProtocolVersion.V31: 3>, length = 22
@pytest.mark.parametrize(
"protocol, length",
[(ProtocolVersion.V31, 22), (ProtocolVersion.V311, 0), (ProtocolVersion.V5, 0)],
)
async def test_client_id(protocol: ProtocolVersion, length: int) -> None:
> client = Client(HOSTNAME, protocol=protocol)
tests/test_client.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0ecdf0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 66 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_id[ProtocolVersion.V311-0]
TypeError: 'type' object is not subscriptable
Raw output
protocol = <ProtocolVersion.V311: 4>, length = 0
@pytest.mark.parametrize(
"protocol, length",
[(ProtocolVersion.V31, 22), (ProtocolVersion.V311, 0), (ProtocolVersion.V5, 0)],
)
async def test_client_id(protocol: ProtocolVersion, length: int) -> None:
> client = Client(HOSTNAME, protocol=protocol)
tests/test_client.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0fcc70>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 66 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_id[ProtocolVersion.V5-0]
TypeError: 'type' object is not subscriptable
Raw output
protocol = <ProtocolVersion.V5: 5>, length = 0
@pytest.mark.parametrize(
"protocol, length",
[(ProtocolVersion.V31, 22), (ProtocolVersion.V311, 0), (ProtocolVersion.V5, 0)],
)
async def test_client_id(protocol: ProtocolVersion, length: int) -> None:
> client = Client(HOSTNAME, protocol=protocol)
tests/test_client.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d1d5b50>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 77 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_will
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_will() -> None:
topic = TOPIC_PREFIX + "test_client_will"
event = anyio.Event()
async def launch_client() -> None:
with anyio.CancelScope(shield=True) as cs:
async with Client(HOSTNAME) as client:
await client.subscribe(topic)
event.set()
async for message in client.messages:
assert message.topic.value == topic
cs.cancel()
async with anyio.create_task_group() as tg:
tg.start_soon(launch_client)
> await event.wait()
tests/test_client.py:86:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.8/site-packages/anyio/_backends/_asyncio.py:597: in __aexit__
raise exceptions[0]
tests/test_client.py:77: in launch_client
async with Client(HOSTNAME) as client:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d00d970>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 100 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_tls_context
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_tls_context() -> None:
topic = TOPIC_PREFIX + "test_client_tls_context"
async def handle(tg: anyio.abc.TaskGroup) -> None:
async for message in client.messages:
assert message.topic.value == topic
tg.cancel_scope.cancel()
> async with Client(
HOSTNAME,
8883,
tls_context=ssl.SSLContext(protocol=ssl.PROTOCOL_TLS),
) as client, anyio.create_task_group() as tg:
tests/test_client.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d15ecd0>
hostname = 'test.mosquitto.org', port = 8883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 120 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_tls_params
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_tls_params() -> None:
topic = TOPIC_PREFIX + "tls_params"
async def handle(tg: anyio.abc.TaskGroup) -> None:
async for message in client.messages:
assert message.topic.value == topic
tg.cancel_scope.cancel()
> async with Client(
HOSTNAME,
8883,
tls_params=TLSParameters(
ca_certs=str(pathlib.Path.cwd() / "tests" / "mosquitto.org.crt")
),
) as client, anyio.create_task_group() as tg:
tests/test_client.py:120:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d1c4e80>
hostname = 'test.mosquitto.org', port = 8883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 142 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_username_password
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_username_password() -> None:
topic = TOPIC_PREFIX + "username_password"
async def handle(tg: anyio.abc.TaskGroup) -> None:
async for message in client.messages:
assert message.topic.value == topic
tg.cancel_scope.cancel()
> async with Client(
HOSTNAME, username="", password=""
) as client, anyio.create_task_group() as tg:
tests/test_client.py:142:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3278b0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 154 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_logger
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_logger() -> None:
logger = logging.getLogger("aiomqtt")
> async with Client(HOSTNAME, logger=logger) as client:
tests/test_client.py:154:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d34da00>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 200 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_max_concurrent_outgoing_calls
TypeError: 'type' object is not subscriptable
Raw output
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10d1d5430>
@pytest.mark.network
async def test_client_max_concurrent_outgoing_calls(
monkeypatch: pytest.MonkeyPatch,
) -> None:
topic = TOPIC_PREFIX + "max_concurrent_outgoing_calls"
class MockPahoClient(mqtt.Client):
def subscribe(
self,
topic: str
| tuple[str, mqtt.SubscribeOptions]
| list[tuple[str, mqtt.SubscribeOptions]]
| list[tuple[str, int]],
qos: int = 0,
options: mqtt.SubscribeOptions | None = None,
properties: mqtt.Properties | None = None,
) -> tuple[int, int]:
assert client._outgoing_calls_sem is not None
assert client._outgoing_calls_sem.locked()
return super().subscribe(topic, qos, options, properties)
def unsubscribe(
self, topic: str | list[str], properties: mqtt.Properties | None = None
) -> tuple[int, int]:
assert client._outgoing_calls_sem is not None
assert client._outgoing_calls_sem.locked()
return super().unsubscribe(topic, properties)
def publish( # noqa: PLR0913
self,
topic: str,
payload: PayloadType | None = None,
qos: int = 0,
retain: bool = False,
properties: mqtt.Properties | None = None,
) -> mqtt.MQTTMessageInfo:
assert client._outgoing_calls_sem is not None
assert client._outgoing_calls_sem.locked()
return super().publish(topic, payload, qos, retain, properties)
monkeypatch.setattr(mqtt, "Client", MockPahoClient)
> async with Client(HOSTNAME, max_concurrent_outgoing_calls=1) as client:
tests/test_client.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d029b20>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 215 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_websockets
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_websockets() -> None:
topic = TOPIC_PREFIX + "websockets"
async def handle(tg: anyio.abc.TaskGroup) -> None:
async for message in client.messages:
assert message.topic.value == topic
tg.cancel_scope.cancel()
> async with Client(
HOSTNAME,
8080,
transport="websockets",
websocket_path="/",
websocket_headers={"foo": "bar"},
) as client:
tests/test_client.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d393c70>
hostname = 'test.mosquitto.org', port = 8080
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 236 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_pending_calls_threshold[10]
TypeError: 'type' object is not subscriptable
Raw output
pending_calls_threshold = 10
caplog = <_pytest.logging.LogCaptureFixture object at 0x10d0ec640>
@pytest.mark.network
@pytest.mark.parametrize("pending_calls_threshold", [10, 20])
async def test_client_pending_calls_threshold(
pending_calls_threshold: int, caplog: pytest.LogCaptureFixture
) -> None:
topic = TOPIC_PREFIX + "pending_calls_threshold"
> async with Client(HOSTNAME) as client:
tests/test_client.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0ec5e0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 236 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_pending_calls_threshold[20]
TypeError: 'type' object is not subscriptable
Raw output
pending_calls_threshold = 20
caplog = <_pytest.logging.LogCaptureFixture object at 0x10d0fce80>
@pytest.mark.network
@pytest.mark.parametrize("pending_calls_threshold", [10, 20])
async def test_client_pending_calls_threshold(
pending_calls_threshold: int, caplog: pytest.LogCaptureFixture
) -> None:
topic = TOPIC_PREFIX + "pending_calls_threshold"
> async with Client(HOSTNAME) as client:
tests/test_client.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0fc7f0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 263 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls[10]
TypeError: 'type' object is not subscriptable
Raw output
pending_calls_threshold = 10
caplog = <_pytest.logging.LogCaptureFixture object at 0x10d16d250>
@pytest.mark.network
@pytest.mark.parametrize("pending_calls_threshold", [10, 20])
async def test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls(
pending_calls_threshold: int,
caplog: pytest.LogCaptureFixture,
) -> None:
topic = (
TOPIC_PREFIX + "no_pending_calls_warnings_with_max_concurrent_outgoing_calls"
)
> async with Client(HOSTNAME, max_concurrent_outgoing_calls=1) as client:
tests/test_client.py:263:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d16df40>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 263 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls[20]
TypeError: 'type' object is not subscriptable
Raw output
pending_calls_threshold = 20
caplog = <_pytest.logging.LogCaptureFixture object at 0x10d029880>
@pytest.mark.network
@pytest.mark.parametrize("pending_calls_threshold", [10, 20])
async def test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls(
pending_calls_threshold: int,
caplog: pytest.LogCaptureFixture,
) -> None:
topic = (
TOPIC_PREFIX + "no_pending_calls_warnings_with_max_concurrent_outgoing_calls"
)
> async with Client(HOSTNAME, max_concurrent_outgoing_calls=1) as client:
tests/test_client.py:263:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d0299d0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 278 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_context_is_reusable
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_context_is_reusable() -> None:
"""Test that a client context manager instance is reusable."""
topic = TOPIC_PREFIX + "test_client_is_reusable"
> client = Client(HOSTNAME)
tests/test_client.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3e7d60>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 288 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_context_is_not_reentrant
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_context_is_not_reentrant() -> None:
"""Test that a client context manager instance is not reentrant."""
> client = Client(HOSTNAME)
tests/test_client.py:288:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d144b80>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 297 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_client_reusable_message
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_client_reusable_message() -> None:
> custom_client = Client(HOSTNAME)
tests/test_client.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3db370>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 333 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_aenter_error_lock_release
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_aenter_error_lock_release() -> None:
"""Test that the client's reusability lock is released on error in ``aenter``."""
> client = Client(hostname="invalid")
tests/test_client.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3701c0>, hostname = 'invalid'
port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 342 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_aexit_without_prior_aenter
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_aexit_without_prior_aenter() -> None:
"""Test that ``aexit`` without prior (or unsuccessful) ``aenter`` runs cleanly."""
> client = Client(HOSTNAME)
tests/test_client.py:342:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3b0820>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 349 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_aexit_consecutive_calls
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_aexit_consecutive_calls() -> None:
"""Test that ``aexit`` runs cleanly when it was already called before."""
> async with Client(HOSTNAME) as client:
tests/test_client.py:349:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d2ea3d0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 356 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_aexit_client_is_already_disconnected_success
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_aexit_client_is_already_disconnected_success() -> None:
"""Test that ``aexit`` runs cleanly if client is already cleanly disconnected."""
> async with Client(HOSTNAME) as client:
tests/test_client.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d34d820>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 363 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_aexit_client_is_already_disconnected_failure
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_aexit_client_is_already_disconnected_failure() -> None:
"""Test that ``aexit`` reraises if client is already disconnected with an error."""
> client = Client(HOSTNAME)
tests/test_client.py:363:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d3d2430>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError
Check failure on line 374 in .mypy_cache/3.8/tests/test_client.data.json
github-actions / Junit reports
test_client.test_messages_generator_is_reusable
TypeError: 'type' object is not subscriptable
Raw output
@pytest.mark.network
async def test_messages_generator_is_reusable() -> None:
"""Test that the messages generator is reusable and returns no duplicates."""
topic = TOPIC_PREFIX + "test_messages_generator_is_reusable"
> async with Client(HOSTNAME) as client:
tests/test_client.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aiomqtt.client.Client object at 0x10d45a9d0>
hostname = 'test.mosquitto.org', port = 1883
def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915
self,
hostname: str,
port: int = 1883,
*,
username: str | None = None,
password: str | None = None,
logger: logging.Logger | None = None,
identifier: str | None = None,
queue_type: type[asyncio.Queue[Message]] | None = None,
protocol: ProtocolVersion | None = None,
will: Will | None = None,
clean_session: bool | None = None,
transport: str = "tcp",
timeout: float | None = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: int = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
max_queued_incoming_messages: int | None = None,
max_queued_outgoing_messages: int | None = None,
max_inflight_messages: int | None = None,
max_concurrent_outgoing_calls: int | None = None,
properties: mqtt.Properties | None = None,
tls_context: ssl.SSLContext | None = None,
tls_params: TLSParameters | None = None,
tls_insecure: bool | None = None,
proxy: ProxySettings | None = None,
socket_options: Iterable[SocketOption] | None = None,
websocket_path: str | None = None,
websocket_headers: WebSocketHeaders | None = None,
) -> None:
self._hostname = hostname
self._port = port
self._keepalive = keepalive
self._bind_address = bind_address
self._bind_port = bind_port
self._clean_start = clean_start
self._properties = properties
self._loop = asyncio.get_event_loop()
# Connection state
self._connected: asyncio.Future[None] = asyncio.Future()
self._disconnected: asyncio.Future[None] = asyncio.Future()
self._lock: asyncio.Lock = asyncio.Lock()
# Pending subscribe, unsubscribe, and publish calls
self._pending_subscribes: dict[
int, asyncio.Future[tuple[int] | list[mqtt.ReasonCodes]]
] = {}
self._pending_unsubscribes: dict[int, asyncio.Event] = {}
self._pending_publishes: dict[int, asyncio.Event] = {}
self.pending_calls_threshold: int = 10
self._misc_task: asyncio.Task[None] | None = None
# Queue that holds incoming messages
if queue_type is None:
> queue_type = asyncio.Queue[Message]
E TypeError: 'type' object is not subscriptable
aiomqtt/client.py:232: TypeError