Skip to content

Commit

Permalink
check import path before parsing (in test)
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicalNinjaDad committed Apr 10, 2024
1 parent 11cf832 commit ccaf55b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pyo3-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ mod tests {
functionname: "function".to_string(),
};

let parsed: Pyo3Import = import.parse_args().unwrap();
let parsed: Option<Pyo3Import>;

assert_eq!(parsed, expected)
if import.path().is_ident("pyo3import") {
parsed = Some(import.parse_args().unwrap());
} else {
parsed = None;
}

assert_eq!(parsed.unwrap(), expected)
}
}

0 comments on commit ccaf55b

Please sign in to comment.