32
32
from _pytest ._io import TerminalWriter
33
33
from _pytest ._io .saferepr import safeformat
34
34
from _pytest ._io .saferepr import saferepr
35
+ from _pytest .compat import ATTRS_EQ_FIELD
35
36
from _pytest .compat import overload
36
37
from _pytest .compat import TYPE_CHECKING
37
38
@@ -911,7 +912,7 @@ def repr_excinfo(self, excinfo: ExceptionInfo) -> "ExceptionChainRepr":
911
912
return ExceptionChainRepr (repr_chain )
912
913
913
914
914
- @attr .s
915
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
915
916
class TerminalRepr :
916
917
def __str__ (self ) -> str :
917
918
# FYI this is called from pytest-xdist's serialization of exception
@@ -928,7 +929,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
928
929
raise NotImplementedError ()
929
930
930
931
931
- @attr .s
932
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
932
933
class ExceptionRepr (TerminalRepr ):
933
934
def __attrs_post_init__ (self ):
934
935
self .sections = [] # type: List[Tuple[str, str, str]]
@@ -942,7 +943,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
942
943
tw .line (content )
943
944
944
945
945
- @attr .s
946
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
946
947
class ExceptionChainRepr (ExceptionRepr ):
947
948
chain = attr .ib (
948
949
type = Sequence [
@@ -966,7 +967,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
966
967
super ().toterminal (tw )
967
968
968
969
969
- @attr .s
970
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
970
971
class ReprExceptionInfo (ExceptionRepr ):
971
972
reprtraceback = attr .ib (type = "ReprTraceback" )
972
973
reprcrash = attr .ib (type = "ReprFileLocation" )
@@ -976,7 +977,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
976
977
super ().toterminal (tw )
977
978
978
979
979
- @attr .s
980
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
980
981
class ReprTraceback (TerminalRepr ):
981
982
reprentries = attr .ib (type = Sequence [Union ["ReprEntry" , "ReprEntryNative" ]])
982
983
extraline = attr .ib (type = Optional [str ])
@@ -1010,7 +1011,7 @@ def __init__(self, tblines: Sequence[str]) -> None:
1010
1011
self .extraline = None
1011
1012
1012
1013
1013
- @attr .s
1014
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
1014
1015
class ReprEntryNative (TerminalRepr ):
1015
1016
lines = attr .ib (type = Sequence [str ])
1016
1017
style = "native" # type: _TracebackStyle
@@ -1019,7 +1020,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
1019
1020
tw .write ("" .join (self .lines ))
1020
1021
1021
1022
1022
- @attr .s
1023
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
1023
1024
class ReprEntry (TerminalRepr ):
1024
1025
lines = attr .ib (type = Sequence [str ])
1025
1026
reprfuncargs = attr .ib (type = Optional ["ReprFuncArgs" ])
@@ -1093,7 +1094,7 @@ def __str__(self) -> str:
1093
1094
)
1094
1095
1095
1096
1096
- @attr .s
1097
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
1097
1098
class ReprFileLocation (TerminalRepr ):
1098
1099
path = attr .ib (type = str , converter = str )
1099
1100
lineno = attr .ib (type = int )
@@ -1110,7 +1111,7 @@ def toterminal(self, tw: TerminalWriter) -> None:
1110
1111
tw .line (":{}: {}" .format (self .lineno , msg ))
1111
1112
1112
1113
1113
- @attr .s
1114
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
1114
1115
class ReprLocals (TerminalRepr ):
1115
1116
lines = attr .ib (type = Sequence [str ])
1116
1117
@@ -1119,7 +1120,7 @@ def toterminal(self, tw: TerminalWriter, indent="") -> None:
1119
1120
tw .line (indent + line )
1120
1121
1121
1122
1122
- @attr .s
1123
+ @attr .s ( ** { ATTRS_EQ_FIELD : False }) # type: ignore
1123
1124
class ReprFuncArgs (TerminalRepr ):
1124
1125
args = attr .ib (type = Sequence [Tuple [str , object ]])
1125
1126
0 commit comments