diff options
author | Matus Valo <matusvalo@gmail.com> | 2020-09-01 23:42:02 +0200 |
---|---|---|
committer | Asif Saif Uddin <auvipy@gmail.com> | 2020-09-02 07:55:06 +0600 |
commit | 23a9359e34553dd18921ca2f7eebec56c3944e11 (patch) | |
tree | 5d222f61f56d39e2d28f6ae2733d0506cda6a7e8 | |
parent | 46bdf6d5d962bd37be8cb9a64d07b51bd597fe3d (diff) | |
download | py-amqp-23a9359e34553dd18921ca2f7eebec56c3944e11.tar.gz |
Migrate another case imports to unittest.mock after dropping python 3.5
-rw-r--r-- | t/integration/test_integration.py | 5 | ||||
-rw-r--r-- | t/unit/test_connection.py | 6 | ||||
-rw-r--r-- | t/unit/test_method_framing.py | 5 | ||||
-rw-r--r-- | t/unit/test_utils.py | 2 |
4 files changed, 5 insertions, 13 deletions
diff --git a/t/integration/test_integration.py b/t/integration/test_integration.py index 89f787f..27712a4 100644 --- a/t/integration/test_integration.py +++ b/t/integration/test_integration.py @@ -1,11 +1,8 @@ import socket from struct import pack +from unittest.mock import ANY, Mock, call, patch import pytest -# python 3.5 does not support assert_called() -# TODO: After dropping support of python3.5 -# unittest.mock can be used instead of case -from case import ANY, Mock, call, patch import amqp from amqp import Channel, Connection, Message, sasl, spec diff --git a/t/unit/test_connection.py b/t/unit/test_connection.py index e59d19c..67dcb85 100644 --- a/t/unit/test_connection.py +++ b/t/unit/test_connection.py @@ -1,11 +1,9 @@ import socket import warnings +from unittest.mock import Mock, call, patch import pytest -# python 3.5 does not support assert_called() -# TODO: After dropping support of python3.5 -# unittest.mock can be used instead of case -from case import ContextMock, Mock, call, patch +from case import ContextMock from amqp import Connection, spec from amqp.connection import SSLError diff --git a/t/unit/test_method_framing.py b/t/unit/test_method_framing.py index 826f901..05f6b72 100644 --- a/t/unit/test_method_framing.py +++ b/t/unit/test_method_framing.py @@ -1,10 +1,7 @@ +from unittest.mock import Mock from struct import pack import pytest -# python 3.5 does not support assert_called() -# TODO: After dropping support of python3.5 -# unittest.mock can be used instead of case -from case import Mock from amqp import spec from amqp.basic_message import Message diff --git a/t/unit/test_utils.py b/t/unit/test_utils.py index 45eb283..60f5079 100644 --- a/t/unit/test_utils.py +++ b/t/unit/test_utils.py @@ -1,4 +1,4 @@ -from case import Mock, patch +from unittest.mock import Mock, patch from amqp.utils import bytes_to_str, coro, get_logger, str_to_bytes |