Provide better output in flaky tests (#163)

This commit is contained in:
morenol
2022-09-20 12:12:09 -04:00
committed by GitHub
parent c21e75276a
commit 69d8be35de
+13 -2
View File
@@ -776,8 +776,13 @@ mod tests {
) )
.and_then(|lr| lr.predict(&x)) .and_then(|lr| lr.predict(&x))
.unwrap(); .unwrap();
let acc = accuracy(&y_hat, &y);
assert!(accuracy(&y_hat, &y) >= 0.9); assert!(
acc >= 0.9,
"accuracy ({}) is not larger or equal to 0.9",
acc
);
} }
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
@@ -860,7 +865,13 @@ mod tests {
.and_then(|lr| lr.predict(&x)) .and_then(|lr| lr.predict(&x))
.unwrap(); .unwrap();
assert!(accuracy(&y_hat, &y) >= 0.9); let acc = accuracy(&y_hat, &y);
assert!(
acc >= 0.9,
"accuracy ({}) is not larger or equal to 0.9",
acc
);
} }
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]