diff --git a/pyo3-testing/src/lib.rs b/pyo3-testing/src/lib.rs index ece0fc7b69f..d01dec548c8 100644 --- a/pyo3-testing/src/lib.rs +++ b/pyo3-testing/src/lib.rs @@ -106,8 +106,14 @@ mod tests { functionname: "function".to_string(), }; - let parsed: Pyo3Import = import.parse_args().unwrap(); + let parsed: Option; - assert_eq!(parsed, expected) + if import.path().is_ident("pyo3import") { + parsed = Some(import.parse_args().unwrap()); + } else { + parsed = None; + } + + assert_eq!(parsed.unwrap(), expected) } }