Skip to content

Commit eb6feb5

Browse files
committed
Make usize_dtype test simpler
1 parent 20ad58c commit eb6feb5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/to_py.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,12 @@ fn usize_dtype() {
7474

7575
let a: Vec<usize> = vec![1, 2, 3];
7676
let x = a.into_pyarray(py);
77-
let x_repr = format!("{:?}", x);
7877

79-
let x_repr_expected = if cfg!(target_pointer_width = "64") {
80-
"array([1, 2, 3], dtype=uint64)"
78+
if cfg!(target_pointer_width = "64") {
79+
pyo3::py_run!(py, x, "assert str(x.dtype) == 'uint64'")
8180
} else {
82-
"array([1, 2, 3], dtype=uint32)"
81+
pyo3::py_run!(py, x, "assert str(x.dtype) == 'uint32'")
8382
};
84-
assert_eq!(x_repr, x_repr_expected);
8583
}
8684

8785
#[test]

0 commit comments

Comments
 (0)