Skip to content

Commit 0b24bb1

Browse files
committed
Add regression test.
1 parent c323698 commit 0b24bb1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

toolz/tests/test_itertoolz.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ def test_partition_all():
318318
assert list(partition_all(3, range(5))) == [(0, 1, 2), (3, 4)]
319319
assert list(partition_all(2, [])) == []
320320

321+
# Regression test: https://github.com/pytoolz/toolz/issues/387
322+
class NoCompare(object):
323+
def __eq__(self, other):
324+
if self.__class__ == other.__class__:
325+
return True
326+
raise ValueError()
327+
obj = NoCompare()
328+
assert list(partition_all(2, [obj]*3)) == [(obj, obj), (obj,)]
329+
330+
321331

322332
def test_count():
323333
assert count((1, 2, 3)) == 3

0 commit comments

Comments
 (0)