From 034d970bc2ad322dcbf8232c189b039d177d2dd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 20:30:58 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../test_strassen_matrix_multiplication.py | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/divide_and_conquer/tests/test_strassen_matrix_multiplication.py b/divide_and_conquer/tests/test_strassen_matrix_multiplication.py index 4e2bf6515..a5e646a75 100644 --- a/divide_and_conquer/tests/test_strassen_matrix_multiplication.py +++ b/divide_and_conquer/tests/test_strassen_matrix_multiplication.py @@ -3,18 +3,8 @@ from divide_and_conquer.strassen_matrix_multiplication import split_matrix def test_4x4_matrix(): - matrix = [ - [4, 3, 2, 4], - [2, 3, 1, 1], - [6, 5, 4, 3], - [8, 4, 1, 6] - ] - expected = ( - [[4, 3], [2, 3]], - [[2, 4], [1, 1]], - [[6, 5], [8, 4]], - [[4, 3], [1, 6]] - ) + matrix = [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]] + expected = ([[4, 3], [2, 3]], [[2, 4], [1, 1]], [[6, 5], [8, 4]], [[4, 3], [1, 6]]) assert split_matrix(matrix) == expected @@ -27,23 +17,19 @@ def test_8x8_matrix(): [4, 3, 2, 4, 4, 3, 2, 4], [2, 3, 1, 1, 2, 3, 1, 1], [6, 5, 4, 3, 6, 5, 4, 3], - [8, 4, 1, 6, 8, 4, 1, 6] + [8, 4, 1, 6, 8, 4, 1, 6], ] expected = ( [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]], [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]], [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]], - [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]] + [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]], ) assert split_matrix(matrix) == expected def test_invalid_odd_matrix(): - matrix = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9] - ] + matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] with pytest.raises(Exception, match="Odd matrices are not supported!"): split_matrix(matrix) @@ -54,7 +40,7 @@ def test_invalid_non_square_matrix(): [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16], - [17, 18, 19, 20] + [17, 18, 19, 20], ] with pytest.raises(Exception, match="Odd matrices are not supported!"): split_matrix(matrix)