Skip to content

Commit 71c653a

Browse files
bluetechpatchback[bot]
authored andcommitted
Merge pull request #13291 from jakkdl/fix_attrs
fix attrs==25.2.0 compatibility (cherry picked from commit 4933d92)
1 parent 400e3bf commit 71c653a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: 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``.

Diff for: src/_pytest/assertion/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def has_default_eq(
161161
code_filename = obj.__eq__.__code__.co_filename
162162

163163
if isattrs(obj):
164-
return "attrs generated eq" in code_filename
164+
return "attrs generated " in code_filename
165165

166166
return code_filename == "<string>" # data class
167167
return True

0 commit comments

Comments
 (0)