diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 618a93eca..860002f4d 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -140,7 +140,8 @@ def has_default_eq( ) -> bool: """Check if an instance of an object contains the default eq - First, we check if the object's __eq__ attribute has __code__, if so, we check the equally of the method code filename (__code__.co_filename) + First, we check if the object's __eq__ attribute has __code__, + if so, we check the equally of the method code filename (__code__.co_filename) to the default onces generated by the dataclass and attr module for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" """