diff options
author | Carlos Chinchilla <cachinchilla@google.com> | 2023-11-01 21:49:37 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-11-01 21:49:37 +0000 |
commit | 3d96f77e48a58d236cb5c891e72ccb7969a6a18a (patch) | |
tree | b132df4f8ce090cb384404c0b70c4f8ce2d3911d /pw_unit_test | |
parent | c841ecda9527cb038fbbb46d5431e75a7b8914cf (diff) | |
download | pigweed-3d96f77e48a58d236cb5c891e72ccb7969a6a18a.tar.gz |
pw_{hdlc,system}: Enforce use of CancellableReader
Stop accepting read callbacks in RpcClients and enforce the use of
CancellableReader objects, which provide a safe clean down process.
Rename the `Device` `read` argument to `reader` to reflect the expected
type.
Bug: 301496598
Change-Id: If9f3c71a556590b7abe4c44391fe2979d5a5409b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/173618
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Diffstat (limited to 'pw_unit_test')
-rw-r--r-- | pw_unit_test/docs.rst | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pw_unit_test/docs.rst b/pw_unit_test/docs.rst index 2c010ca31..e1dd9cc8a 100644 --- a/pw_unit_test/docs.rst +++ b/pw_unit_test/docs.rst @@ -706,15 +706,16 @@ the results of the test run. from pw_hdlc import rpc from pw_unit_test.rpc import run_tests - PROTO = Path(os.environ['PW_ROOT'], - 'pw_unit_test/pw_unit_test_proto/unit_test.proto') + PROTO = Path( + os.environ['PW_ROOT'], + 'pw_unit_test/pw_unit_test_proto/unit_test.proto' + ) serial_device = serial.Serial(device, baud) with rpc.SerialReader(serial_device) as reader: - with rpc.HdlcRpcClient( - reader, - PROTO, - rpc.default_channels(serial_device.write)) as client: - run_tests(client.rpcs()) + with rpc.HdlcRpcClient( + reader, PROTO, rpc.default_channels(serial_device.write) + ) as client: + run_tests(client.rpcs()) pw_unit_test.rpc ---------------- |