File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ def _style(message: str, **kwargs: Any) -> str:
55
55
return _formatter .style (message , ** kwargs )
56
56
57
57
58
+ def _truncate (message : str , length : int ) -> str :
59
+ if len (message ) > length :
60
+ return message [:length - 3 ] + "..."
61
+ return message
62
+
63
+
58
64
class StubtestFailure (Exception ):
59
65
pass
60
66
@@ -86,7 +92,7 @@ def __init__(
86
92
self .stub_object = stub_object
87
93
self .runtime_object = runtime_object
88
94
self .stub_desc = stub_desc or str (getattr (stub_object , "type" , stub_object ))
89
- self .runtime_desc = runtime_desc or str ( runtime_object )
95
+ self .runtime_desc = runtime_desc or _truncate ( repr ( runtime_object ), 100 )
90
96
91
97
def is_missing_stub (self ) -> bool :
92
98
"""Whether or not the error is for something missing from the stub."""
You can’t perform that action at this time.
0 commit comments