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/worker_thread.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'rust/tests/worker_thread.rs') diff --git a/rust/tests/worker_thread.rs b/rust/tests/worker_thread.rs index 666e85ba..1d30c13a 100644 --- a/rust/tests/worker_thread.rs +++ b/rust/tests/worker_thread.rs @@ -1,15 +1,9 @@ use binaryninja::headless::Session; -use rstest::*; use std::sync::{Arc, Barrier}; -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} - -#[rstest] -fn test_setting_worker_thread(_session: &Session) { +#[test] +fn test_setting_worker_thread() { + let _session = Session::new().expect("Failed to initialize session"); let original_count = binaryninja::worker_thread::worker_thread_count(); binaryninja::worker_thread::set_worker_thread_count(original_count - 1); assert_eq!( @@ -23,8 +17,9 @@ fn test_setting_worker_thread(_session: &Session) { ); } -#[rstest] -fn test_worker_thread_different(_session: &Session) { +#[test] +fn test_worker_thread_different() { + let _session = Session::new().expect("Failed to initialize session"); let calling_thread = std::thread::current(); // We need both (2) threads to synchronize -- cgit v1.3.1