summaryrefslogtreecommitdiff
path: root/rust/tests/background_task.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-26 20:56:18 -0500
committerMason Reed <mason@vector35.com>2025-02-26 21:05:34 -0500
commitdc8015f6695ee069279dfbd681000e8b1fcd30e5 (patch)
treec1e387c68a249ff90999bbdcc4fa90372516d88c /rust/tests/background_task.rs
parent4608523101738492124069765324141966372229 (diff)
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.
Diffstat (limited to 'rust/tests/background_task.rs')
-rw-r--r--rust/tests/background_task.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/rust/tests/background_task.rs b/rust/tests/background_task.rs
index d0c329e3..6e0c354b 100644
--- a/rust/tests/background_task.rs
+++ b/rust/tests/background_task.rs
@@ -1,15 +1,9 @@
use binaryninja::background_task::*;
use binaryninja::headless::Session;
-use rstest::*;
-#[fixture]
-#[once]
-fn session() -> Session {
- Session::new().expect("Failed to initialize session")
-}
-
-#[rstest]
-fn test_background_task_registered(_session: &Session) {
+#[test]
+fn test_background_task_registered() {
+ let _session = Session::new().expect("Failed to initialize session");
let task_progress = "test registered";
let task = BackgroundTask::new(task_progress, false);
BackgroundTask::running_tasks()
@@ -24,8 +18,9 @@ fn test_background_task_registered(_session: &Session) {
assert!(!still_running, "Task still running");
}
-#[rstest]
-fn test_background_task_cancellable(_session: &Session) {
+#[test]
+fn test_background_task_cancellable() {
+ let _session = Session::new().expect("Failed to initialize session");
let task_progress = "test cancellable";
let task = BackgroundTask::new(task_progress, false);
BackgroundTask::running_tasks()
@@ -37,8 +32,9 @@ fn test_background_task_cancellable(_session: &Session) {
task.finish();
}
-#[rstest]
-fn test_background_task_progress(_session: &Session) {
+#[test]
+fn test_background_task_progress() {
+ let _session = Session::new().expect("Failed to initialize session");
let task = BackgroundTask::new("test progress", false);
let first_progress = task.progress_text().to_string();
assert_eq!(first_progress, "test progress");