Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion checks/itertools/itertools3.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
assert coordinates == [(0, "low"), (0, "high"), (1, "low"), (1, "high")]
assert coordinates == [
(0, "low"),
(0, "high"),
(1, "low"),
(1, "high"),
], (
"coordinates should contain every (x, y) pair from xs and ys, "
f"got {coordinates!r}"
)
print("itertools3 ok")
8 changes: 7 additions & 1 deletion checks/itertools/itertools4.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
assert grouped == {"fruit": ["apple", "pear"], "veg": ["carrot"]}
assert grouped == {
"fruit": ["apple", "pear"],
"veg": ["carrot"],
}, (
"grouped should map each category to its item names, "
f"got {grouped!r}"
)
print("itertools4 ok")
5 changes: 4 additions & 1 deletion checks/itertools/itertools5.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
assert running_totals == [3, 7, 12, 18]
assert running_totals == [3, 7, 12, 18], (
"running_totals should contain cumulative sums [3, 7, 12, 18], "
f"got {running_totals!r}"
)
print("itertools5 ok")
5 changes: 4 additions & 1 deletion checks/itertools/itertools6.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
assert repeated == ["red", "blue", "red", "blue", "red", "blue"]
assert repeated == ["red", "blue", "red", "blue", "red", "blue"], (
"repeated should cycle through colors for six values, "
f"got {repeated!r}"
)
print("itertools6 ok")
5 changes: 4 additions & 1 deletion checks/itertools/itertools7.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
assert pairs == [("a", 1), ("b", "?"), ("c", "?")]
assert pairs == [("a", 1), ("b", "?"), ("c", "?")], (
"pairs should fill missing right-side values with '?', "
f"got {pairs!r}"
)
print("itertools7 ok")
10 changes: 8 additions & 2 deletions checks/itertools/itertools8.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
assert flattened == [1, 2, 3, 4, 5]
assert adjacent_pairs == [(1, 2), (2, 3), (3, 4), (4, 5)]
assert flattened == [1, 2, 3, 4, 5], (
"flattened should contain all batch items in order, "
f"got {flattened!r}"
)
assert adjacent_pairs == [(1, 2), (2, 3), (3, 4), (4, 5)], (
"adjacent_pairs should contain each neighboring pair, "
f"got {adjacent_pairs!r}"
)
print("itertools8 ok")
Loading