|
6 | 6 |
|
7 | 7 |
|
8 | 8 | @pytest.mark.parametrize( |
9 | | - 'output, expected', |
| 9 | + "output, expected", |
10 | 10 | [ |
11 | 11 | ( |
12 | 12 | { |
|
19 | 19 | "i8": np.int8(1.0), |
20 | 20 | "i16": np.int16(1.0), |
21 | 21 | "i32": np.int32(1.0), |
22 | | - "i64": np.int64(1.0) |
| 22 | + "i64": np.int64(1.0), |
23 | 23 | }, |
24 | 24 | '{"f_": 1.0, "f16": 1.0, "f32": 1.0, "f64": 1.0, "i_": ' |
25 | | - + '1, "i0": 1, "i8": 1, "i16": 1, "i32": 1, "i64": 1}' |
| 25 | + + '1, "i0": 1, "i8": 1, "i16": 1, "i32": 1, "i64": 1}', |
26 | 26 | ), |
27 | 27 | ( |
28 | 28 | { |
29 | | - 'ints': np.full(1, 1, dtype=np.int8), |
30 | | - 'floats': np.full(1, 1, dtype=np.float32) |
| 29 | + "ints": np.full(1, 1, dtype=np.int8), |
| 30 | + "floats": np.full(1, 1, dtype=np.float32), |
31 | 31 | }, |
32 | | - '{"ints": [1], "floats": [1.0]}' |
| 32 | + '{"ints": [1], "floats": [1.0]}', |
33 | 33 | ), |
34 | | - ( |
35 | | - np.full((2, 2, 2), 1, dtype=np.int8), |
36 | | - '[[[1, 1], [1, 1]], [[1, 1], [1, 1]]]' |
37 | | - ) |
38 | | - ] |
| 34 | + (np.full((2, 2, 2), 1, dtype=np.int8), "[[[1, 1], [1, 1]], [[1, 1], [1, 1]]]"), |
| 35 | + ], |
39 | 36 | ) |
40 | 37 | def test_numpy_encoder(output, expected): |
41 | 38 | assert json.dumps(output, cls=NumpyEncoder) == expected |
0 commit comments