From c042eb5dee8f257d7bfb15b5acc4201e75a04a94 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 30 Sep 2024 16:05:11 -0500 Subject: [PATCH] Improve display of `assert_public_ty` assertion failures --- crates/red_knot_python_semantic/src/types/infer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/red_knot_python_semantic/src/types/infer.rs b/crates/red_knot_python_semantic/src/types/infer.rs index 0652f1ac7739b5..cbd57540fef799 100644 --- a/crates/red_knot_python_semantic/src/types/infer.rs +++ b/crates/red_knot_python_semantic/src/types/infer.rs @@ -2948,7 +2948,11 @@ mod tests { let file = system_path_to_file(db, file_name).expect("Expected file to exist."); let ty = global_symbol_ty(db, file, symbol_name); - assert_eq!(ty.display(db).to_string(), expected); + assert_eq!( + ty.display(db).to_string(), + expected, + "Mismatch for symbol '{symbol_name}' in '{file_name}'" + ); } fn assert_scope_ty(