Skip to content

Commit

Permalink
Make flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
gleb-akhmerov committed Oct 15, 2022
1 parent e0c19d1 commit 5ef7562
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_recipes.py
Expand Up @@ -783,7 +783,7 @@ def test_some_true(self):
before, after = mi.before_and_after(bool, [1, True, 0, False])
self.assertEqual(list(before), [1, True])
self.assertEqual(list(after), [0, False])

@staticmethod
def _group_events(events):
events = iter(events)
Expand All @@ -802,16 +802,18 @@ def _group_events(events):
numbers, events = mi.before_and_after(lambda e: isinstance(e, int), events)

yield (operation, numbers)

def test_nested_remainder(self):
events = ["SUM", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] * 1000
events += ["MULTIPLY", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] * 1000

for operation, numbers in self._group_events(events):
if operation == "SUM":
res = sum(numbers)
self.assertEqual(res, 55)
elif operation == "MULTIPLY":
res = reduce(lambda a, b: a * b, numbers)
self.assertEqual(res, 3628800)


class TriplewiseTests(TestCase):
Expand Down

0 comments on commit 5ef7562

Please sign in to comment.