Skip to content

Commit

Permalink
Fixed some tuple/list mismatch in test_comms
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Feb 26, 2021
1 parent 5436e2c commit 4d14409
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions distributed/comm/tests/test_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ async def check_deserialize(addr):
msg = {
"op": "update",
"x": b"abc",
"to_ser": (to_serialize(123),),
"to_ser": [to_serialize(123)],
"ser": Serialized(*serialize(456)),
}
msg_orig = msg.copy()
Expand All @@ -1036,7 +1036,7 @@ def check_out_false(out_value):
assert isinstance(ser, Serialized)
assert deserialize(ser.header, ser.frames) == 456

assert isinstance(to_ser, tuple) and len(to_ser) == 1
assert isinstance(to_ser, list) and len(to_ser) == 1
(to_ser,) = to_ser
# The to_serialize() value could have been actually serialized
# or not (it's a transport-specific optimization)
Expand All @@ -1049,7 +1049,7 @@ def check_out_true(out_value):
# Check output with deserialize=True
expected_msg = msg.copy()
expected_msg["ser"] = 456
expected_msg["to_ser"] = (123,)
expected_msg["to_ser"] = [123]
assert out_value == expected_msg

await check_listener_deserialize(addr, False, msg, check_out_false)
Expand Down

0 comments on commit 4d14409

Please sign in to comment.