Skip to content

Commit b785456

Browse files
jakkdlbluetech
authored andcommitted
fix attrs==25.2.0 compatibility
1 parent d149ab3 commit b785456

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog/13291.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed ``repr`` of ``attrs`` objects in assertion failure messages when using ``attrs>=25.2``.

src/_pytest/assertion/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def has_default_eq(
169169
code_filename = obj.__eq__.__code__.co_filename
170170

171171
if isattrs(obj):
172-
return "attrs generated eq" in code_filename
172+
return "attrs generated " in code_filename
173173

174174
return code_filename == "<string>" # data class
175175
return True

0 commit comments

Comments
 (0)