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/main_thread.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'rust/tests/main_thread.rs') diff --git a/rust/tests/main_thread.rs b/rust/tests/main_thread.rs index f74414d5..a42157a9 100644 --- a/rust/tests/main_thread.rs +++ b/rust/tests/main_thread.rs @@ -1,22 +1,16 @@ use binaryninja::headless::Session; -use rstest::*; // TODO: Add a test for MainThreadHandler -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} - -#[rstest] -fn test_not_main_thread(_session: &Session) { +#[test] +fn test_not_main_thread() { // We should never be the main thread. assert!(!binaryninja::is_main_thread()) } -#[rstest] -fn test_main_thread_different(_session: &Session) { +#[test] +fn test_main_thread_different() { + let _session = Session::new().expect("Failed to initialize session"); let calling_thread = std::thread::current(); binaryninja::main_thread::execute_on_main_thread_and_wait(move || { let main_thread = std::thread::current(); -- cgit v1.3.1