3232from _pytest ._io import TerminalWriter
3333from _pytest ._io .saferepr import safeformat
3434from _pytest ._io .saferepr import saferepr
35+ from _pytest .compat import ATTRS_EQ_FIELD
3536from _pytest .compat import overload
3637from _pytest .compat import TYPE_CHECKING
3738
@@ -911,7 +912,7 @@ def repr_excinfo(self, excinfo: ExceptionInfo) -> "ExceptionChainRepr":
911912 return ExceptionChainRepr (repr_chain )
912913
913914
914- @attr .s
915+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
915916class TerminalRepr :
916917 def __str__ (self ) -> str :
917918 # FYI this is called from pytest-xdist's serialization of exception
@@ -928,7 +929,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
928929 raise NotImplementedError ()
929930
930931
931- @attr .s
932+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
932933class ExceptionRepr (TerminalRepr ):
933934 def __attrs_post_init__ (self ):
934935 self .sections = [] # type: List[Tuple[str, str, str]]
@@ -942,7 +943,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
942943 tw .line (content )
943944
944945
945- @attr .s
946+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
946947class ExceptionChainRepr (ExceptionRepr ):
947948 chain = attr .ib (
948949 type = Sequence [
@@ -966,7 +967,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
966967 super ().toterminal (tw )
967968
968969
969- @attr .s
970+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
970971class ReprExceptionInfo (ExceptionRepr ):
971972 reprtraceback = attr .ib (type = "ReprTraceback" )
972973 reprcrash = attr .ib (type = "ReprFileLocation" )
@@ -976,7 +977,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
976977 super ().toterminal (tw )
977978
978979
979- @attr .s
980+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
980981class ReprTraceback (TerminalRepr ):
981982 reprentries = attr .ib (type = Sequence [Union ["ReprEntry" , "ReprEntryNative" ]])
982983 extraline = attr .ib (type = Optional [str ])
@@ -1010,7 +1011,7 @@ def __init__(self, tblines: Sequence[str]) -> None:
10101011 self .extraline = None
10111012
10121013
1013- @attr .s
1014+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
10141015class ReprEntryNative (TerminalRepr ):
10151016 lines = attr .ib (type = Sequence [str ])
10161017 style = "native" # type: _TracebackStyle
@@ -1019,7 +1020,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
10191020 tw .write ("" .join (self .lines ))
10201021
10211022
1022- @attr .s
1023+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
10231024class ReprEntry (TerminalRepr ):
10241025 lines = attr .ib (type = Sequence [str ])
10251026 reprfuncargs = attr .ib (type = Optional ["ReprFuncArgs" ])
@@ -1093,7 +1094,7 @@ def __str__(self) -> str:
10931094 )
10941095
10951096
1096- @attr .s
1097+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
10971098class ReprFileLocation (TerminalRepr ):
10981099 path = attr .ib (type = str , converter = str )
10991100 lineno = attr .ib (type = int )
@@ -1110,7 +1111,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
11101111 tw .line (":{}: {}" .format (self .lineno , msg ))
11111112
11121113
1113- @attr .s
1114+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
11141115class ReprLocals (TerminalRepr ):
11151116 lines = attr .ib (type = Sequence [str ])
11161117
@@ -1119,7 +1120,7 @@ def toterminal(self, tw: TerminalWriter, indent="") -> None:
11191120 tw .line (indent + line )
11201121
11211122
1122- @attr .s
1123+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
11231124class ReprFuncArgs (TerminalRepr ):
11241125 args = attr .ib (type = Sequence [Tuple [str , object ]])
11251126
0 commit comments