Skip to content

Commit 7c5b075

Browse files
committed
pylint.
1 parent a69d25f commit 7c5b075

11 files changed

+12
-11
lines changed

examples/client_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def setup_async_client(description=None, cmdline=None):
5353
server=False, description=description, cmdline=cmdline
5454
)
5555
_logger.info("### Create client object")
56+
client = None
5657
if args.comm == "tcp":
5758
client = modbusClient.AsyncModbusTcpClient(
5859
args.host,

examples/client_sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def setup_sync_client(description=None, cmdline=None):
5858
cmdline=cmdline,
5959
)
6060
_logger.info("### Create client object")
61+
client = None
6162
if args.comm == "tcp":
6263
client = modbusClient.ModbusTcpClient(
6364
args.host,

examples/server_async.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def setup_server(description=None, context=None, cmdline=None):
7070
args = helper.get_commandline(server=True, description=description, cmdline=cmdline)
7171
if context:
7272
args.context = context
73+
datablock = None
7374
if not args.context:
7475
_logger.info("### Create datastore")
7576
# The datastores only respond to the addresses that are initialized
@@ -153,6 +154,7 @@ async def run_async_server(args):
153154
"""Run server."""
154155
txt = f"### start ASYNC server, listening on {args.port} - {args.comm}"
155156
_logger.info(txt)
157+
server = None
156158
if args.comm == "tcp":
157159
address = (args.host if args.host else "", args.port if args.port else None)
158160
server = await StartAsyncTcpServer(

examples/server_sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def run_sync_server(args):
6666
"""Run server."""
6767
txt = f"### start SYNC server, listening on {args.port} - {args.comm}"
6868
_logger.info(txt)
69+
server = None
6970
if args.comm == "tcp":
7071
address = ("", args.port) if args.port else None
7172
server = StartTcpServer(

pymodbus/framer/socket_framer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def decode_data(self, data):
6060
}
6161
return {}
6262

63-
def frameProcessIncomingPacket(self, single, callback, slave, tid=None, **kwargs): # noqa: C901
63+
def frameProcessIncomingPacket(self, single, callback, slave, tid=None, **kwargs):
6464
"""Process new packet pattern.
6565
6666
This takes in a new request packet, adds it to the current

test/sub_client/test_client_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Test client sync."""
22
import socket
33
from itertools import count
4-
from test.conftest import mockSocket
54
from unittest import mock
65

76
import pytest
@@ -22,6 +21,7 @@
2221
ModbusSocketFramer,
2322
ModbusTlsFramer,
2423
)
24+
from test.conftest import mockSocket
2525

2626

2727
# ---------------------------------------------------------------------------#

test/sub_function_codes/test_bit_read_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Read Coils
88
"""
99
import struct
10-
from test.conftest import MockContext
1110

1211
from pymodbus.bit_read_message import (
1312
ReadBitsRequestBase,
@@ -16,6 +15,7 @@
1615
ReadDiscreteInputsRequest,
1716
)
1817
from pymodbus.pdu import ModbusExceptions
18+
from test.conftest import MockContext
1919

2020

2121
res = [True] * 21

test/sub_function_codes/test_bit_write_messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* Read/Write Discretes
77
* Read Coils
88
"""
9-
from test.conftest import FakeList, MockContext
10-
119
from pymodbus.bit_write_message import (
1210
WriteMultipleCoilsRequest,
1311
WriteMultipleCoilsResponse,
1412
WriteSingleCoilRequest,
1513
WriteSingleCoilResponse,
1614
)
1715
from pymodbus.pdu import ModbusExceptions
16+
from test.conftest import FakeList, MockContext
1817

1918

2019
# ---------------------------------------------------------------------------#

test/sub_function_codes/test_register_read_messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""Test register read messages."""
2-
from test.conftest import FakeList, MockContext
3-
42
from pymodbus.pdu import ModbusExceptions
53
from pymodbus.register_read_message import (
64
ReadHoldingRegistersRequest,
@@ -12,6 +10,7 @@
1210
ReadWriteMultipleRegistersRequest,
1311
ReadWriteMultipleRegistersResponse,
1412
)
13+
from test.conftest import FakeList, MockContext
1514

1615

1716
TEST_MESSAGE = b"\x06\x00\x0a\x00\x0b\x00\x0c"

test/sub_function_codes/test_register_write_messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""Test register write messages."""
2-
from test.conftest import MockContext, MockLastValuesContext
3-
42
from pymodbus.payload import BinaryPayloadBuilder, Endian
53
from pymodbus.pdu import ModbusExceptions
64
from pymodbus.register_write_message import (
@@ -11,6 +9,7 @@
119
WriteSingleRegisterRequest,
1210
WriteSingleRegisterResponse,
1311
)
12+
from test.conftest import MockContext, MockLastValuesContext
1413

1514

1615
# ---------------------------------------------------------------------------#

test/test_file_message.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* Read/Write Discretes
77
* Read Coils
88
"""
9-
from test.conftest import MockContext
10-
119
from pymodbus.file_message import (
1210
FileRecord,
1311
ReadFifoQueueRequest,
@@ -18,6 +16,7 @@
1816
WriteFileRecordResponse,
1917
)
2018
from pymodbus.pdu import ModbusExceptions
19+
from test.conftest import MockContext # pylint: disable=wrong-import-order
2120

2221

2322
TEST_MESSAGE = b"\x00\n\x00\x08\x00\x01\x00\x02\x00\x03\x00\x04"

0 commit comments

Comments
 (0)