From dc8015f6695ee069279dfbd681000e8b1fcd30e5 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 26 Feb 2025 20:56:18 -0500 Subject: Remove module level `Session` initialization in Rust unit tests This was preventing the enterprise license checkout from dropping, also the initialization story is much better than it was when we added the rstest fixtures, we can get away with initialization in parallel more broadly. --- rust/tests/workflow.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'rust/tests/workflow.rs') diff --git a/rust/tests/workflow.rs b/rust/tests/workflow.rs index fcede59c..148d66fd 100644 --- a/rust/tests/workflow.rs +++ b/rust/tests/workflow.rs @@ -1,19 +1,13 @@ use binaryninja::headless::Session; use binaryninja::settings::Settings; use binaryninja::workflow::Workflow; -use rstest::*; - -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} // TODO: Test running a workflow activity // TODO: Test activity insertion and removal -#[rstest] -fn test_workflow_clone(_session: &Session) { +#[test] +fn test_workflow_clone() { + let _session = Session::new().expect("Failed to initialize session"); let original_workflow = Workflow::new("core.function.baseAnalysis"); let mut cloned_workflow = original_workflow.clone("clone_workflow"); @@ -30,8 +24,9 @@ fn test_workflow_clone(_session: &Session) { ); } -#[rstest] -fn test_workflow_registration(_session: &Session) { +#[test] +fn test_workflow_registration() { + let _session = Session::new().expect("Failed to initialize session"); // Validate NULL workflows cannot be registered let workflow = Workflow::new("null"); assert_eq!(workflow.name().as_str(), "null"); -- cgit v1.3.1