Skip to content

Commit 01882f9

Browse files
authored
Examples coverage nearly 100%. (#1694)
1 parent 40643e4 commit 01882f9

26 files changed

+599
-602
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
run: pip install -e . -r requirements.txt
9595

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

9999
analyze:
100100
name: Analyze Python

doc/source/examples.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ Asynchronous server
5454
^^^^^^^^^^^^^^^^^^^
5555
.. literalinclude:: ../../examples/server_async.py
5656

57-
Build bcd Payload
58-
^^^^^^^^^^^^^^^^^
59-
.. literalinclude:: ../../examples/build_bcd_payload.py
60-
6157
Callback Server example
6258
^^^^^^^^^^^^^^^^^^^^^^^
6359
.. literalinclude:: ../../examples/server_callback.py

examples/build_bcd_payload.py

Lines changed: 0 additions & 222 deletions
This file was deleted.

examples/client_async.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ async def run_a_few_calls(client):
143143
pass
144144

145145

146+
async def main(cmdline=None):
147+
"""Combine setup and run."""
148+
testclient = setup_async_client(description="Run client.", cmdline=cmdline)
149+
await run_async_client(testclient, modbus_calls=run_a_few_calls)
150+
151+
146152
if __name__ == "__main__":
147-
testclient = setup_async_client(description="Run asynchronous client.")
148-
asyncio.run(run_async_client(testclient, modbus_calls=run_a_few_calls), debug=True)
153+
asyncio.run(main(), debug=True) # pragma: no cover

0 commit comments

Comments
 (0)