File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
distributed/shuffle/tests Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from pickle import PickleBuffer
4+
35import pytest
46
57from distributed .shuffle ._core import _mean_shard_size
@@ -12,7 +14,17 @@ def test_mean_shard_size():
1214 # Don't fully iterate over large collections
1315 assert _mean_shard_size ([b"12" * n for n in range (1000 )]) == 9
1416 # Support any Buffer object
15- assert _mean_shard_size ([b"12" , bytearray (b"1234" ), memoryview (b"123456" )]) == 4
17+ assert (
18+ _mean_shard_size (
19+ [
20+ b"12" ,
21+ bytearray (b"1234" ),
22+ memoryview (b"123456" ),
23+ PickleBuffer (b"12345678" ),
24+ ]
25+ )
26+ == 5
27+ )
1628 # Recursion into lists or tuples; ignore int
1729 assert _mean_shard_size ([(1 , 2 , [3 , b"123456" ])]) == 6
1830 # Don't blindly call sizeof() on unexpected objects
You can’t perform that action at this time.
0 commit comments