diff --git a/src/types/list.rs b/src/types/list.rs index cd298c88..53cac952 100644 --- a/src/types/list.rs +++ b/src/types/list.rs @@ -367,7 +367,7 @@ where mod tests { use crate::types::PyList; use crate::Python; - use crate::{IntoPy, Py, PyAny, PyObject, PyTryFrom, ToPyObject}; + use crate::{IntoPy, PyObject, PyTryFrom, ToPyObject}; #[test] fn test_new() { @@ -826,10 +826,11 @@ mod tests { }) } + #[cfg(feature = "macros")] #[test] fn bad_clone_mem_leaks() { + use crate::{Py, PyAny}; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; - static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0); #[crate::pyclass] diff --git a/src/types/tuple.rs b/src/types/tuple.rs index 2385aad5..5e0d6ca0 100644 --- a/src/types/tuple.rs +++ b/src/types/tuple.rs @@ -456,7 +456,7 @@ tuple_conversion!( #[cfg(test)] mod tests { use crate::types::{PyAny, PyTuple}; - use crate::{IntoPy, Py, PyTryFrom, Python, ToPyObject}; + use crate::{PyTryFrom, Python, ToPyObject}; use std::collections::HashSet; #[test] @@ -809,8 +809,10 @@ mod tests { }) } + #[cfg(feature = "macros")] #[test] fn bad_clone_mem_leaks() { + use crate::{IntoPy, Py}; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0); @@ -875,8 +877,10 @@ mod tests { ); } + #[cfg(feature = "macros")] #[test] fn bad_clone_mem_leaks_2() { + use crate::{IntoPy, Py}; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0);