From 6736c0a4144f815fe77e7c0e402b34c47c9db868 Mon Sep 17 00:00:00 2001 From: Manuel Liebert Date: Tue, 17 Dec 2024 12:03:54 +0100 Subject: [PATCH] Specify requirements versions and adapt to non positional arguments --- tests/requirements.txt | 14 +++++++------- tests/test_modbus.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 2a921c5..c171b42 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,7 +1,7 @@ -pytest -pytest-cov -pytest-asyncio -pymodbus -asyncio -asyncua -requests \ No newline at end of file +pytest==8.3.4 +pytest-cov==6.0.0 +pytest-asyncio==0.25.0 +pymodbus==3.8.0 +asyncio==0.6 +asyncua==1.1.0 +requests==2.25.1 diff --git a/tests/test_modbus.py b/tests/test_modbus.py index 4c519bc..fef027c 100644 --- a/tests/test_modbus.py +++ b/tests/test_modbus.py @@ -51,7 +51,7 @@ def test_read_holding_register(modbus_client): """ # Address of the register (Modbus address is often 0-based) register_address = 1 - result = modbus_client.read_holding_registers(register_address, 1) + result = modbus_client.read_holding_registers(register_address, count=1) # Check if we received a valid response assert result is not None, "No response from the Modbus server" @@ -73,7 +73,7 @@ def test_write_single_register(modbus_client): assert not result.isError(), f"Modbus error: {result}" # Verify that the value was written correctly by reading it back - read_result = modbus_client.read_holding_registers(register_address, 1) + read_result = modbus_client.read_holding_registers(register_address, count=1) assert read_result.registers[0] == value_to_write, f"Expected {value_to_write}, got {read_result.registers[0]}" @pytest.mark.asyncio