Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/13291.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``repr`` of ``attrs`` objects in assertion failure messages when using ``attrs>=25.2``.
2 changes: 1 addition & 1 deletion src/_pytest/assertion/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def has_default_eq(
code_filename = obj.__eq__.__code__.co_filename

if isattrs(obj):
return "attrs generated eq" in code_filename
return "attrs generated " in code_filename

return code_filename == "<string>" # data class
return True
Expand Down
Loading