Skip to content

Commit 034d970

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6e00c5d commit 034d970

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

divide_and_conquer/tests/test_strassen_matrix_multiplication.py

+6-20
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,8 @@
33

44

55
def test_4x4_matrix():
6-
matrix = [
7-
[4, 3, 2, 4],
8-
[2, 3, 1, 1],
9-
[6, 5, 4, 3],
10-
[8, 4, 1, 6]
11-
]
12-
expected = (
13-
[[4, 3], [2, 3]],
14-
[[2, 4], [1, 1]],
15-
[[6, 5], [8, 4]],
16-
[[4, 3], [1, 6]]
17-
)
6+
matrix = [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]]
7+
expected = ([[4, 3], [2, 3]], [[2, 4], [1, 1]], [[6, 5], [8, 4]], [[4, 3], [1, 6]])
188
assert split_matrix(matrix) == expected
199

2010

@@ -27,23 +17,19 @@ def test_8x8_matrix():
2717
[4, 3, 2, 4, 4, 3, 2, 4],
2818
[2, 3, 1, 1, 2, 3, 1, 1],
2919
[6, 5, 4, 3, 6, 5, 4, 3],
30-
[8, 4, 1, 6, 8, 4, 1, 6]
20+
[8, 4, 1, 6, 8, 4, 1, 6],
3121
]
3222
expected = (
3323
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3424
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3525
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
36-
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]]
26+
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3727
)
3828
assert split_matrix(matrix) == expected
3929

4030

4131
def test_invalid_odd_matrix():
42-
matrix = [
43-
[1, 2, 3],
44-
[4, 5, 6],
45-
[7, 8, 9]
46-
]
32+
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
4733
with pytest.raises(Exception, match="Odd matrices are not supported!"):
4834
split_matrix(matrix)
4935

@@ -54,7 +40,7 @@ def test_invalid_non_square_matrix():
5440
[5, 6, 7, 8],
5541
[9, 10, 11, 12],
5642
[13, 14, 15, 16],
57-
[17, 18, 19, 20]
43+
[17, 18, 19, 20],
5844
]
5945
with pytest.raises(Exception, match="Odd matrices are not supported!"):
6046
split_matrix(matrix)

0 commit comments

Comments
 (0)