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/demangler.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'rust/tests/demangler.rs') diff --git a/rust/tests/demangler.rs b/rust/tests/demangler.rs index da57f67e..3c1d0216 100644 --- a/rust/tests/demangler.rs +++ b/rust/tests/demangler.rs @@ -6,16 +6,10 @@ use binaryninja::demangle::{ use binaryninja::headless::Session; use binaryninja::rc::Ref; use binaryninja::types::{QualifiedName, Type}; -use rstest::*; -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} - -#[rstest] -fn test_demangler_simple(_session: &Session) { +#[test] +fn test_demangler_simple() { + let _session = Session::new().expect("Failed to initialize session"); let placeholder_arch = CoreArchitecture::by_name("x86").expect("x86 exists"); // Example LLVM-style mangled name let llvm_mangled = "_Z3fooi"; // "foo(int)" in LLVM mangling @@ -45,8 +39,9 @@ fn test_demangler_simple(_session: &Session) { ); } -#[rstest] -fn test_custom_demangler(_session: &Session) { +#[test] +fn test_custom_demangler() { + let _session = Session::new().expect("Failed to initialize session"); struct TestDemangler; impl CustomDemangler for TestDemangler { -- cgit v1.3.1