Skip to content

Commit 8d4f4b4

Browse files
authored
Fix typos (supressed_exception_classessuppressed_exception_classes) (#82)
1 parent d82ddbd commit 8d4f4b4

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

stompman/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import asyncio
2-
from collections.abc import AsyncGenerator, Callable, Coroutine
2+
from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine
33
from contextlib import AsyncExitStack, asynccontextmanager
44
from dataclasses import dataclass, field
55
from functools import partial
6+
import inspect
67
from ssl import SSLContext
78
from types import TracebackType
89
from typing import ClassVar, Literal, Self
@@ -144,15 +145,15 @@ async def subscribe(
144145
ack: AckMode = "client-individual",
145146
headers: dict[str, str] | None = None,
146147
on_suppressed_exception: Callable[[Exception, MessageFrame], None],
147-
supressed_exception_classes: tuple[type[Exception], ...] = (Exception,),
148+
suppressed_exception_classes: tuple[type[Exception], ...] = (Exception,),
148149
) -> "Subscription":
149150
subscription = Subscription(
150151
destination=destination,
151152
handler=handler,
152153
headers=headers,
153154
ack=ack,
154155
on_suppressed_exception=on_suppressed_exception,
155-
supressed_exception_classes=supressed_exception_classes,
156+
suppressed_exception_classes=suppressed_exception_classes,
156157
_connection_manager=self._connection_manager,
157158
_active_subscriptions=self._active_subscriptions,
158159
)

stompman/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def write_frame(self, frame: AnyClientFrame) -> None:
8888
async def _read_non_empty_bytes(self, max_chunk_size: int) -> bytes:
8989
while ( # noqa: ASYNC110
9090
chunk := await self.reader.read(max_chunk_size)
91-
) == b"": # pragma: no cover (it defenitely happens)
91+
) == b"": # pragma: no cover (it definitely happens)
9292
await asyncio.sleep(0)
9393
return chunk
9494

stompman/subscription.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Subscription:
2424
handler: Callable[[MessageFrame], Coroutine[None, None, None]]
2525
ack: AckMode
2626
on_suppressed_exception: Callable[[Exception, MessageFrame], None]
27-
supressed_exception_classes: tuple[type[Exception], ...]
27+
suppressed_exception_classes: tuple[type[Exception], ...]
2828
_connection_manager: ConnectionManager
2929
_active_subscriptions: ActiveSubscriptions
3030

@@ -48,7 +48,7 @@ async def unsubscribe(self) -> None:
4848
async def _run_handler(self, *, frame: MessageFrame) -> None:
4949
try:
5050
await self.handler(frame)
51-
except self.supressed_exception_classes as exception:
51+
except self.suppressed_exception_classes as exception:
5252
if self._should_handle_ack_nack and self.id in self._active_subscriptions:
5353
await self._connection_manager.maybe_write_frame(
5454
NackFrame(

stompman/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ async def __aexit__(
2929
await self._connection_manager.maybe_write_frame(AbortFrame(headers={"transaction": self.id}))
3030
self._active_transactions.remove(self)
3131
else:
32-
commited = await self._connection_manager.maybe_write_frame(CommitFrame(headers={"transaction": self.id}))
33-
if commited:
32+
committed = await self._connection_manager.maybe_write_frame(CommitFrame(headers={"transaction": self.id}))
33+
if committed:
3434
self._active_transactions.remove(self)
3535

3636
async def send(

tests/test_subscription.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
@pytest.mark.parametrize("ack", get_args(AckMode))
41-
async def test_client_subscribtions_lifespan_resubscribe(ack: AckMode, faker: faker.Faker) -> None:
41+
async def test_client_subscriptions_lifespan_resubscribe(ack: AckMode, faker: faker.Faker) -> None:
4242
connection_class, collected_frames = create_spying_connection(*get_read_frames_with_lifespan([CONNECTED_FRAME], []))
4343
client = EnrichedClient(connection_class=connection_class)
4444
sub_destination, message_destination, message_body = faker.pystr(), faker.pystr(), faker.binary(length=10)
@@ -78,7 +78,7 @@ async def test_client_subscribtions_lifespan_resubscribe(ack: AckMode, faker: fa
7878
)
7979

8080

81-
async def test_client_subscribtions_lifespan_no_active_subs_in_aexit(
81+
async def test_client_subscriptions_lifespan_no_active_subs_in_aexit(
8282
monkeypatch: pytest.MonkeyPatch, faker: faker.Faker
8383
) -> None:
8484
monkeypatch.setattr(
@@ -109,7 +109,7 @@ async def test_client_subscribtions_lifespan_no_active_subs_in_aexit(
109109

110110

111111
@pytest.mark.parametrize("direct_error", [True, False])
112-
async def test_client_subscribtions_lifespan_with_active_subs_in_aexit(
112+
async def test_client_subscriptions_lifespan_with_active_subs_in_aexit(
113113
monkeypatch: pytest.MonkeyPatch,
114114
faker: faker.Faker,
115115
*,

0 commit comments

Comments
 (0)