Skip to content

Commit 1f0c0c7

Browse files
committed
Fix linting
1 parent f1222a2 commit 1f0c0c7

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/test_backoff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
"""exponential back-off tests"""
66

7-
import pytest
7+
88
import socket
99
import ssl
1010
import time
1111
from unittest.mock import call, patch
1212

13+
import pytest
1314
import adafruit_minimqtt.adafruit_minimqtt as MQTT
1415

1516

tests/test_loop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
"""loop() tests"""
66

7-
import pytest
87
import random
98
import socket
109
import ssl
@@ -14,6 +13,7 @@
1413
from unittest.mock import patch
1514
from unittest import mock
1615

16+
import pytest
1717
import adafruit_minimqtt.adafruit_minimqtt as MQTT
1818

1919

@@ -158,6 +158,7 @@ def test_loop_basic(self) -> None:
158158
assert ret_code == expected_rc
159159
expected_rc += 1
160160

161+
# pylint: disable=no-self-use
161162
# pylint: disable=invalid-name
162163
def test_loop_timeout_vs_socket_timeout(self):
163164
"""
@@ -178,6 +179,7 @@ def test_loop_timeout_vs_socket_timeout(self):
178179

179180
assert "loop timeout" in str(context)
180181

182+
# pylint: disable=no-self-use
181183
def test_loop_is_connected(self):
182184
"""
183185
loop() should throw MMQTTException if not connected

tests/test_port_ssl.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
"""tests that verify the connect behavior w.r.t. port number and TLS"""
66

7-
import pytest
87
import socket
98
import ssl
109
from unittest.mock import Mock, call, patch
1110

11+
import pytest
1212
import adafruit_minimqtt.adafruit_minimqtt as MQTT
1313

1414

@@ -17,6 +17,7 @@ class TestPortSslSetup:
1717
These tests assume that there is no MQTT broker running on the hosts/ports they connect to.
1818
"""
1919

20+
# pylint: disable=no-self-use
2021
def test_default_port(self) -> None:
2122
"""verify default port value and that TLS is not used"""
2223
host = "127.0.0.1"
@@ -44,6 +45,7 @@ def test_default_port(self) -> None:
4445
# Assuming the repeated calls will have the same arguments.
4546
connect_mock.assert_has_calls([call((host, expected_port))])
4647

48+
# pylint: disable=no-self-use
4749
def test_connect_override(self):
4850
"""Test that connect() can override host and port."""
4951
host = "127.0.0.1"
@@ -69,6 +71,7 @@ def test_connect_override(self):
6971
# Assuming the repeated calls will have the same arguments.
7072
connect_mock.assert_has_calls([call((expected_host, expected_port))])
7173

74+
# pylint: disable=no-self-use
7275
@pytest.mark.parametrize("port", (None, 8883))
7376
def test_tls_port(self, port) -> None:
7477
"""verify that when is_ssl=True is set, the default port is 8883
@@ -104,6 +107,7 @@ def test_tls_port(self, port) -> None:
104107
# Assuming the repeated calls will have the same arguments.
105108
connect_mock.assert_has_calls([call((host, expected_port))])
106109

110+
# pylint: disable=no-self-use
107111
def test_tls_without_ssl_context(self) -> None:
108112
"""verify that when is_ssl=True is set, the code will check that ssl_context is not None"""
109113
host = "127.0.0.1"

0 commit comments

Comments
 (0)