Skip to content

Commit

Permalink
Improve display of assert_public_ty assertion failures (#13577)
Browse files Browse the repository at this point in the history
While working on #13576 I noticed
that it was really hard to tell which assertion failed in some of these
test cases. This could be expanded to elsewhere, but I've heard this
test suite format won't be around for long?
  • Loading branch information
zanieb authored Sep 30, 2024
1 parent c9c748a commit 9d8a4c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/red_knot_python_semantic/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9d8a4c0

Please sign in to comment.