Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pymodbus simulator instead of python mock #9

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

alexrudd2
Copy link
Owner

@alexrudd2 alexrudd2 commented May 23, 2024

Closes #1.

Use a pymodbus server (with a datastore for all modbus registers) to simulate the full Modbus request/reply roundtrip. This is more robust than mock.py.

Note the intermediate commit of using the full pymodbus simulator with HTTP functionality. It's not needed but might as well keep it in the commit log for future info.

Known issues:

  • The teardown for the simulated server sometimes happens multiple times / out-of-order with pytest-xdist on pymodbus 2.5.3

@alexrudd2 alexrudd2 force-pushed the pymodbus-sim branch 5 times, most recently from a644441 to 25c3b88 Compare May 24, 2024 20:10
@alexrudd2 alexrudd2 marked this pull request as ready for review May 24, 2024 20:15
@alexrudd2 alexrudd2 force-pushed the pymodbus-sim branch 6 times, most recently from 3d0e4c6 to e816723 Compare May 25, 2024 17:43
@alexrudd2
Copy link
Owner Author

The failing test is an actual failure on pymodbus 3.7.x. (I've got it pinned in pyproject.toml as a stop-gap)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock at pymodbus level
1 participant