Skip to content

Commit

Permalink
Test all frames are writable
Browse files Browse the repository at this point in the history
User code working with NumPy or Pandas objects often expects the objects
to be mutable. However if read-only frames (like `bytes`) objects are
used, this is not true. So add a test to check for this so that we can
make sure this is true and we can catch and fix cases where that may not
be true.
  • Loading branch information
jakirkham committed Jul 17, 2020
1 parent 8457257 commit 2fb24e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions distributed/protocol/tests/test_protocol_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_merge_frames(lengths, frames):
data = data[i:]

assert all(isinstance(f, memoryview) for f in result)
assert all(not f.readonly for f in result)
assert list(map(ensure_bytes, result)) == expected


Expand Down

0 comments on commit 2fb24e5

Please sign in to comment.