/
python2-dumb-UTF-8-nocolor.out
178 lines (126 loc) · 6.07 KB
/
python2-dumb-UTF-8-nocolor.out
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
python2 test/test.py
Traceback (most recent call last):
File "test/test.py", line 16, in <module>
shallow(bar, 15)
│ └ 2
└ <function shallow at 0xDEADBEEF>
File "test/test.py", line 7, in shallow
deep(a + b)
│ │ └ 15
│ └ 2
└ <function deep at 0xDEADBEEF>
File "test/test.py", line 12, in deep
assert val > 10 and foo == 60
│ └ 52
└ 17
AssertionError: assert val > 10 and foo == 60
python2 test/test_color.py
False
python2 test/test_encoding.py
Traceback (most recent call last):
File "test/test_encoding.py", line 13, in <module>
div()
└ <function div at 0xDEADBEEF>
File "test/test_encoding.py", line 10, in div
return _deep("天")
└ <function _deep at 0xDEADBEEF>
File "test/test_encoding.py", line 7, in _deep
return 1 / val
└ '天'
TypeError: unsupported operand type(s) for /: 'int' and 'str'
./test/test_interactive.sh
spawn python2 -m better_exceptions -q
>>> import better_exceptions
>>> def foo(a):
... assert a > 10
...
>>> foo(1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
foo(1)
└ <function foo at 0xDEADBEEF>
File "<console>", line 2, in foo
assert a > 10
└ 1
AssertionError: assert a > 10
>>> exit()
./test/test_string.sh
import better_exceptions; a = 5; assert a > 10 # this should work fine
Traceback (most recent call last):
File "<string>", line 1, in <module>
import better_exceptions; a = 5; assert a > 10 # this should work fine
│ └ 5
└ 5
AssertionError: import better_exceptions; a = 5; assert a > 10 # this should work fine
Traceback (most recent call last):
File "<string>", line 1, in <module>
import better_exceptions; a = 5; assert a > 10 # this should work fine
│ └ 5
└ 5
AssertionError: import better_exceptions; a = 5; assert a > 10 # this should work fine
from __future__ import print_function; import better_exceptions; a = "why hello there"; print(a); assert False
Traceback (most recent call last):
File "<string>", line 1, in <module>
from __future__ import print_function; import better_exceptions; a = "why hello there"; print(a); assert False
│ └ 'why hello there'
└ 'why hello there'
AssertionError: from __future__ import print_function; import better_exceptions; a = "why hello there"; print(a); assert False
why hello there
Traceback (most recent call last):
File "<string>", line 1, in <module>
from __future__ import print_function; import better_exceptions; a = "why hello there"; print(a); assert False
│ └ 'why hello there'
└ 'why hello there'
AssertionError: from __future__ import print_function; import better_exceptions; a = "why hello there"; print(a); assert False
why hello there
from __future__ import print_function; import better_exceptions; a = "why hello " + " there"; print(a); assert False
Traceback (most recent call last):
File "<string>", line 1, in <module>
from __future__ import print_function; import better_exceptions; a = "why hello " + " there"; print(a); assert False
│ └ 'why hello there'
└ 'why hello there'
AssertionError: from __future__ import print_function; import better_exceptions; a = "why hello " + " there"; print(a); assert False
why hello there
Traceback (most recent call last):
File "<string>", line 1, in <module>
from __future__ import print_function; import better_exceptions; a = "why hello " + " there"; print(a); assert False
│ └ 'why hello there'
└ 'why hello there'
AssertionError: from __future__ import print_function; import better_exceptions; a = "why hello " + " there"; print(a); assert False
why hello there
python2 test/test_logging.py
ERROR:__main__:callback failed
Traceback (most recent call last):
File "test/test_logging.py", line 15, in foo
cb()
└ <function bar3 at 0xDEADBEEF>
File "test/test_logging.py", line 32, in bar3
raise Exception('this is a test exception')
Exception: this is a test exception
ERROR:__main__:callback failed
Traceback (most recent call last):
File "test/test_logging.py", line 15, in foo
cb()
└ <function bar4 at 0xDEADBEEF>
File "test/test_logging.py", line 37, in bar4
assert baz == 90
└ 52
AssertionError: assert baz == 90
python2 test/test_truncating.py
Traceback (most recent call last):
File "test/test_truncating.py", line 11, in <module>
div()
└ <function ...
File "test/test_truncating.py", line 8, in div
return 1 / var
└ '999999999...
TypeError: unsupported operand type(s) for /: 'int' and 'str'
python2 test/test_truncating_disabled.py
Traceback (most recent call last):
File "test/test_truncating_disabled.py", line 11, in <module>
div()
└ <function div at 0xDEADBEEF>
File "test/test_truncating_disabled.py", line 8, in div
return 1 / var
└ '999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
TypeError: unsupported operand type(s) for /: 'int' and 'str'