()
| 34 | |
| 35 | #[test] |
| 36 | fn convert_array_on_extract() { |
| 37 | Python::attach(|py| { |
| 38 | let locals = get_np_locals(py); |
| 39 | let py_array = py |
| 40 | .eval( |
| 41 | c_str!("np.array([[1,2],[3,4]], dtype='int32')"), |
| 42 | Some(&locals), |
| 43 | None, |
| 44 | ) |
| 45 | .unwrap(); |
| 46 | let extracted_array = py_array |
| 47 | .extract::<PyArrayLike2<'_, f64, AllowTypeChange>>() |
| 48 | .unwrap(); |
| 49 | |
| 50 | assert_eq!( |
| 51 | array![[1_f64, 2_f64], [3_f64, 4_f64]], |
| 52 | extracted_array.as_array() |
| 53 | ); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | #[test] |
| 58 | fn convert_list_on_extract() { |
nothing calls this directly
no test coverage detected