|
14 | 14 | MatrixValue = None | bool | int | float | str |
15 | 15 | Matrix = MatrixValue | list["Matrix"] | dict[str, "Matrix"] |
16 | 16 |
|
17 | | -try: |
18 | | - compute_matrix_product_script = runpy.run_path( |
19 | | - str( |
20 | | - pathlib.Path(__file__).parent |
21 | | - / "../../../../cpp/cmake/modules/compute_matrix_product.py" |
22 | | - ) |
23 | | - ) |
24 | | -except FileNotFoundError: |
25 | | - pytest.skip( |
26 | | - "Could not find compute_matrix_product.py", allow_module_level=True |
| 17 | +compute_matrix_product_script = runpy.run_path( |
| 18 | + str( |
| 19 | + pathlib.Path(__file__).parent |
| 20 | + / "../../../../cpp/cmake/modules/compute_matrix_product.py" |
27 | 21 | ) |
28 | | -else: |
29 | | - iterate_matrix_product: "Callable[[Matrix], Generator[dict[str, MatrixValue]]]" = compute_matrix_product_script[ |
30 | | - "iterate_matrix_product" |
31 | | - ] |
32 | | - NoKeyError: type[ValueError] = compute_matrix_product_script["NoKeyError"] |
33 | | - UnusedKeyWarning: type[UserWarning] = compute_matrix_product_script[ |
34 | | - "UnusedKeyWarning" |
35 | | - ] |
36 | | - UsedKeyWarning: type[UserWarning] = compute_matrix_product_script[ |
37 | | - "UsedKeyWarning" |
38 | | - ] |
| 22 | +) |
| 23 | + |
| 24 | +iterate_matrix_product: "Callable[[Matrix], Generator[dict[str, MatrixValue]]]" = compute_matrix_product_script[ |
| 25 | + "iterate_matrix_product" |
| 26 | +] |
| 27 | +NoKeyError: type[ValueError] = compute_matrix_product_script["NoKeyError"] |
| 28 | +UnusedKeyWarning: type[UserWarning] = compute_matrix_product_script[ |
| 29 | + "UnusedKeyWarning" |
| 30 | +] |
| 31 | +UsedKeyWarning: type[UserWarning] = compute_matrix_product_script[ |
| 32 | + "UsedKeyWarning" |
| 33 | +] |
39 | 34 |
|
40 | 35 |
|
41 | 36 | @pytest.mark.parametrize( |
@@ -251,7 +246,7 @@ def test_iterate_matrix_product( |
251 | 246 | assert ( |
252 | 247 | list( |
253 | 248 | iterate_matrix_product( |
254 | | - matrix, warn_unused=warn_unused, warn_used=warn_used |
| 249 | + matrix=matrix, warn_unused=warn_unused, warn_used=warn_used |
255 | 250 | ) |
256 | 251 | ) |
257 | 252 | == expected_product |
|
0 commit comments