(mat1, mat2)
| 56 | ("mat1", "mat2"), [(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)] |
| 57 | ) |
| 58 | def test_subtraction(mat1, mat2): |
| 59 | if (np.array(mat1)).shape < (2, 2) or (np.array(mat2)).shape < (2, 2): |
| 60 | logger.info(f"\n\t{test_subtraction.__name__} returned integer") |
| 61 | with pytest.raises(TypeError): |
| 62 | matop.subtract(mat1, mat2) |
| 63 | elif (np.array(mat1)).shape == (np.array(mat2)).shape: |
| 64 | logger.info(f"\n\t{test_subtraction.__name__} with same matrix dims") |
| 65 | act = (np.array(mat1) - np.array(mat2)).tolist() |
| 66 | theo = matop.subtract(mat1, mat2) |
| 67 | assert theo == act |
| 68 | else: |
| 69 | logger.info(f"\n\t{test_subtraction.__name__} with different matrix dims") |
| 70 | with pytest.raises(ValueError): |
| 71 | assert matop.subtract(mat1, mat2) |
| 72 | |
| 73 | |
| 74 | @pytest.mark.mat_ops |
nothing calls this directly
no outgoing calls
no test coverage detected