Skip to content

Commit 8fd773d

Browse files
authored
Fix pymodbus.simulator. (#2773)
1 parent 92b39c6 commit 8fd773d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pymodbus/server/simulator/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,9 @@ async def run_main(cmdline=None):
115115
task = ModbusSimulatorServer(**cmd_args)
116116
await task.run_forever()
117117

118+
def main(): # pragma: no cover
119+
"""Run simulator."""
120+
asyncio.run(run_main(), debug=True)
121+
118122
if __name__ == "__main__":
119123
asyncio.run(run_main(), debug=True)

test/datastore/test_remote_datastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ def test_remote_device_set_values_wrong(self):
9999
"""Test setting values against a remote device context."""
100100
client = mock.MagicMock()
101101
context = RemoteDeviceContext(client)
102-
with pytest.raises(ValueError, match="setValues*"):
102+
with pytest.raises(ValueError, match=r"setValues*"):
103103
context.setValues(0x01, 0, [1])

test/transport/test_serial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def test_force_poll(self):
9797
async def test_write_force_poll(self):
9898
"""Test write with poll."""
9999
SerialTransport.force_poll = True
100-
transport, protocol = await create_serial_connection(
100+
transport, _ = await create_serial_connection(
101101
asyncio.get_running_loop(), mock.Mock, "dummy"
102102
)
103103
await asyncio.sleep(0)

0 commit comments

Comments
 (0)