()
| 117 | |
| 118 | #[test] |
| 119 | fn unsafe_cast_shall_fail() { |
| 120 | Python::attach(|py| { |
| 121 | let locals = get_np_locals(py); |
| 122 | let py_list = py |
| 123 | .eval( |
| 124 | c_str!("np.array([1.1,2.2,3.3,4.4], dtype='float64')"), |
| 125 | Some(&locals), |
| 126 | None, |
| 127 | ) |
| 128 | .unwrap(); |
| 129 | let extracted_array = py_list.extract::<PyArrayLike1<'_, i32>>(); |
| 130 | |
| 131 | assert!(extracted_array.is_err()); |
| 132 | }); |
| 133 | } |
| 134 | |
| 135 | #[test] |
| 136 | fn extract_1d_array_of_different_float_types_fail() { |
nothing calls this directly
no test coverage detected