Skip to content

Commit 850b99c

Browse files
authored
Merge pull request #13294 from pytest-dev/patchback/backports/8.3.x/4933d9223ffb3e9c1f11a4a2623be5d32672e071/pr-13291
[PR #13291/4933d922 backport][8.3.x] fix attrs==25.2.0 compatibility
2 parents 400e3bf + 71c653a commit 850b99c

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
@@ -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)