diff --git a/tutorial/tests/test_11_functional_programming.py b/tutorial/tests/test_11_functional_programming.py index 892d3c12..d1e785de 100644 --- a/tutorial/tests/test_11_functional_programming.py +++ b/tutorial/tests/test_11_functional_programming.py @@ -162,7 +162,8 @@ def reference_exercise1(matrix: List[List[int]]) -> List[List[int]]: [(np.eye(3)), (np.random.randint(0, 100, size=(4, 4)))], ) def test_exercise1( - function_to_test: Callable[[List[List[int]]], List[List[int]]], my_input: NDArray + function_to_test: Callable[[List[List[int]]], List[List[int]]], + my_input: NDArray, ): res = function_to_test(my_input.tolist()) assert ( @@ -209,12 +210,14 @@ def reference_exercise3(words: List[str]) -> List[Tuple[str, int]]: return [ (k, len(list(v))) for k, v in itertools.groupby( - sorted(words, key=lambda x: x[0]), key=lambda x: x[0] + sorted(words, key=lambda x: x.lower()[0]), key=lambda x: x.lower()[0] ) ] -def test_exercise3(function_to_test: Callable[[List[str]], List[Tuple[str, int]]]): +def test_exercise3( + function_to_test: Callable[[List[str]], List[Tuple[str, int]]], +): data = get_data_exercise3() assert function_to_test(data) == reference_exercise3(data) @@ -224,7 +227,9 @@ def test_exercise3(function_to_test: Callable[[List[str]], List[Tuple[str, int]] # -def reference_exercise4(my_list: List[Tuple[str, int]]) -> List[Tuple[str, float]]: +def reference_exercise4( + my_list: List[Tuple[str, int]], +) -> List[Tuple[str, float]]: total = sum(map(lambda x: x[1], my_list)) # noqa: C417 return [(letter, freq / total) for letter, freq in my_list]