Skip to content

Commit

Permalink
Specify requirements versions and adapt to non positional arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
manliebert committed Dec 18, 2024
1 parent 08a7881 commit 648a5e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion software/hwio-raspberry/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pymodbus
pymodbus==3.7.4
smbus
nmcli
RPi.GPIO
2 changes: 1 addition & 1 deletion software/hwio-virtual/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pymodbus
pymodbus==3.7.4
nicegui
14 changes: 7 additions & 7 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pytest
pytest-cov
pytest-asyncio
pymodbus
asyncio
asyncua
requests
pytest==8.3.4
pytest-cov==6.0.0
pytest-asyncio==0.25.0
pymodbus==3.7.4
asyncio==3.4.3
asyncua==1.1.0
requests==2.25.1
4 changes: 2 additions & 2 deletions tests/test_modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 648a5e9

Please sign in to comment.