MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / unbind_works

Function unbind_works

tests/array.rs:470–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

468
469#[test]
470fn unbind_works() {
471 let arr: Py<PyArray1<_>> = Python::attach(|py| {
472 let arr = PyArray::from_slice(py, &[1_i32, 2, 3]);
473
474 arr.unbind()
475 });
476
477 Python::attach(|py| {
478 let arr = arr.bind(py);
479
480 assert_eq!(arr.readonly().as_slice().unwrap(), &[1, 2, 3]);
481 });
482}
483
484#[test]
485fn copy_to_works() {

Callers

nothing calls this directly

Calls 1

from_sliceFunction · 0.85

Tested by

no test coverage detected