From 11533c508668f9604ec56a00b3589ef0127fec8d Mon Sep 17 00:00:00 2001 From: Luc Georges <luc.sydney.georges@gmail.com> Date: Tue, 14 Jan 2025 02:59:55 +0100 Subject: [PATCH] fix: tests --- bindings/python/src/processors.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/src/processors.rs b/bindings/python/src/processors.rs index a8dd31486..945d8b2fc 100644 --- a/bindings/python/src/processors.rs +++ b/bindings/python/src/processors.rs @@ -602,7 +602,7 @@ pub fn processors(m: &Bound<'_, PyModule>) -> PyResult<()> { #[cfg(test)] mod test { - use std::sync::Arc; + use std::sync::{Arc, RwLock}; use pyo3::prelude::*; use tk::processors::bert::BertProcessing; @@ -637,15 +637,15 @@ mod test { assert_eq!(py_ser, rs_wrapper_ser); let py_processing: PyPostProcessor = serde_json::from_str(&rs_processing_ser).unwrap(); - match py_processing.processor.as_ref() { + match *py_processing.processor.as_ref().read().unwrap() { PostProcessorWrapper::Bert(_) => (), _ => panic!("Expected Bert postprocessor."), } let py_processing: PyPostProcessor = serde_json::from_str(&rs_wrapper_ser).unwrap(); - match py_processing.processor.as_ref() { + match *py_processing.processor.as_ref().read().unwrap() { PostProcessorWrapper::Bert(_) => (), _ => panic!("Expected Bert postprocessor."), - } + }; } }