Skip to content

Commit

Permalink
Examples coverage nearly 100%. (#1694)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored Jul 24, 2023
1 parent 40643e4 commit 01882f9
Show file tree
Hide file tree
Showing 26 changed files with 599 additions and 602 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: pip install -e . -r requirements.txt

- name: pytest
run: pytest -n0 --cov=pymodbus --cov=test --cov=examples --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
run: pytest -n0 -v --full-trace --timeout=20

analyze:
name: Analyze Python
Expand Down
4 changes: 0 additions & 4 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ Asynchronous server
^^^^^^^^^^^^^^^^^^^
.. literalinclude:: ../../examples/server_async.py

Build bcd Payload
^^^^^^^^^^^^^^^^^
.. literalinclude:: ../../examples/build_bcd_payload.py

Callback Server example
^^^^^^^^^^^^^^^^^^^^^^^
.. literalinclude:: ../../examples/server_callback.py
Expand Down
222 changes: 0 additions & 222 deletions examples/build_bcd_payload.py

This file was deleted.

9 changes: 7 additions & 2 deletions examples/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ async def run_a_few_calls(client):
pass


async def main(cmdline=None):
"""Combine setup and run."""
testclient = setup_async_client(description="Run client.", cmdline=cmdline)
await run_async_client(testclient, modbus_calls=run_a_few_calls)


if __name__ == "__main__":
testclient = setup_async_client(description="Run asynchronous client.")
asyncio.run(run_async_client(testclient, modbus_calls=run_a_few_calls), debug=True)
asyncio.run(main(), debug=True) # pragma: no cover
Loading

0 comments on commit 01882f9

Please sign in to comment.