|
5 | 5 |
|
6 | 6 |
|
7 | 7 | @pytest.mark.parametrize( |
8 | | - "inputs, expected", |
| 8 | + "linear_coefficient, constant, expected", |
9 | 9 | [ |
10 | | - ([0, 0], 0), |
11 | | - ([-99.99, 12.50], 9.936397678254531), |
12 | | - ([-4, 0], 2), |
13 | | - ([10, 0], 0), |
14 | | - ([-7, -7], 3.04891734), |
15 | | - ([100, 72], 0), |
16 | | - ([1, 3], 0), |
17 | | - ([0, -7], 0), |
18 | | - ([-9, 0], 3), |
19 | | - ([-9, 3], 2.8169), |
20 | | - ([[2, 2], 2], [0, 0]), |
21 | | - ([[[2, 2], [2, 2]], 2], [[0, 0], [0, 0]]), |
22 | | - ([[[[3, 2], [-2, -2], [100, 0]]], 2], [[[0, 0], [0, 0], [0, 0]]]), |
| 10 | + (0, 0, 0), |
| 11 | + (-99.99, 12.50, 9.936397678254531), |
| 12 | + (-4, 0, 2), |
| 13 | + (10, 0, 0), |
| 14 | + (-7, -7, 3.04891734), |
| 15 | + (100, 72, 0), |
| 16 | + (1, 3, 0), |
| 17 | + (0, -7, 0), |
| 18 | + (-9, 0, 3), |
| 19 | + (-9, 3, 2.8169), |
| 20 | + ([2, 2], 2, [0, 0]), |
| 21 | + ([[2, 2], [2, 2]], 2, [[0, 0], [0, 0]]), |
| 22 | + ([[[3, 2], [-2, -2], [100, 0]]], 2, [[[0, 0], [0, 0], [0, 0]]]), |
23 | 23 | ], |
24 | 24 | ) |
25 | | -def test_rooth(inputs, expected): |
26 | | - linear_coefficient, constants = inputs |
27 | | - actual = compute_root(linear_coefficient, constants) |
| 25 | +def test_rooth(linear_coefficient, constant, expected): |
| 26 | + actual = compute_root(linear_coefficient, constant) |
28 | 27 | np.testing.assert_allclose(actual, expected, rtol=1e-4) |
0 commit comments