diff --git a/tests/test_backoff.py b/tests/test_backoff.py index 573b205..e26d07a 100644 --- a/tests/test_backoff.py +++ b/tests/test_backoff.py @@ -4,12 +4,13 @@ """exponential back-off tests""" -import pytest + import socket import ssl import time from unittest.mock import call, patch +import pytest import adafruit_minimqtt.adafruit_minimqtt as MQTT diff --git a/tests/test_loop.py b/tests/test_loop.py index 9253b56..4d79b65 100644 --- a/tests/test_loop.py +++ b/tests/test_loop.py @@ -4,7 +4,6 @@ """loop() tests""" -import pytest import random import socket import ssl @@ -14,6 +13,7 @@ from unittest.mock import patch from unittest import mock +import pytest import adafruit_minimqtt.adafruit_minimqtt as MQTT @@ -158,6 +158,7 @@ def test_loop_basic(self) -> None: assert ret_code == expected_rc expected_rc += 1 + # pylint: disable=no-self-use # pylint: disable=invalid-name def test_loop_timeout_vs_socket_timeout(self): """ @@ -178,6 +179,7 @@ def test_loop_timeout_vs_socket_timeout(self): assert "loop timeout" in str(context) + # pylint: disable=no-self-use def test_loop_is_connected(self): """ loop() should throw MMQTTException if not connected diff --git a/tests/test_port_ssl.py b/tests/test_port_ssl.py index 4204bb6..9ac154d 100644 --- a/tests/test_port_ssl.py +++ b/tests/test_port_ssl.py @@ -4,11 +4,11 @@ """tests that verify the connect behavior w.r.t. port number and TLS""" -import pytest import socket import ssl from unittest.mock import Mock, call, patch +import pytest import adafruit_minimqtt.adafruit_minimqtt as MQTT @@ -17,6 +17,7 @@ class TestPortSslSetup: These tests assume that there is no MQTT broker running on the hosts/ports they connect to. """ + # pylint: disable=no-self-use def test_default_port(self) -> None: """verify default port value and that TLS is not used""" host = "127.0.0.1" @@ -44,6 +45,7 @@ def test_default_port(self) -> None: # Assuming the repeated calls will have the same arguments. connect_mock.assert_has_calls([call((host, expected_port))]) + # pylint: disable=no-self-use def test_connect_override(self): """Test that connect() can override host and port.""" host = "127.0.0.1" @@ -69,6 +71,7 @@ def test_connect_override(self): # Assuming the repeated calls will have the same arguments. connect_mock.assert_has_calls([call((expected_host, expected_port))]) + # pylint: disable=no-self-use @pytest.mark.parametrize("port", (None, 8883)) def test_tls_port(self, port) -> None: """verify that when is_ssl=True is set, the default port is 8883 @@ -104,6 +107,7 @@ def test_tls_port(self, port) -> None: # Assuming the repeated calls will have the same arguments. connect_mock.assert_has_calls([call((host, expected_port))]) + # pylint: disable=no-self-use def test_tls_without_ssl_context(self) -> None: """verify that when is_ssl=True is set, the code will check that ssl_context is not None""" host = "127.0.0.1"