diff options
Diffstat (limited to 't/unit/test_common.py')
-rw-r--r-- | t/unit/test_common.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/unit/test_common.py b/t/unit/test_common.py index 0f669b7d..fd20243f 100644 --- a/t/unit/test_common.py +++ b/t/unit/test_common.py @@ -1,4 +1,7 @@ +from __future__ import annotations + import socket +from typing import TYPE_CHECKING from unittest.mock import Mock, patch import pytest @@ -10,6 +13,9 @@ from kombu.common import (PREFETCH_COUNT_MAX, Broadcast, QoS, collect_replies, maybe_declare, send_reply) from t.mocks import ContextMock, MockPool +if TYPE_CHECKING: + from types import TracebackType + def test_generate_oid(): from uuid import NAMESPACE_OID @@ -338,7 +344,12 @@ class MockConsumer: self.consumers.add(self) return self - def __exit__(self, *exc_info): + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None + ) -> None: self.consumers.discard(self) |