File: python3-dumb-UTF-8-nocolor.out

package info (click to toggle)
python-better-exceptions 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 632 kB
  • sloc: python: 620; sh: 108; makefile: 5
file content (210 lines) | stat: -rw-r--r-- 8,457 bytes parent folder | download | duplicates (2)
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
python3 test/test.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 17, in <module>
    shallow(bar, 15)
    │       └ 2
    └ <function shallow at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 8, in shallow
    deep(a + b)
    │    │   └ 15
    │    └ 2
    └ <function deep at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 13, in deep
    assert val > 10 and foo == 60
           │            └ 52
           └ 17
AssertionError: assert val > 10 and foo == 60



python3 test/test_color.py


False



python3 test/test_encoding.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 14, in <module>
    div()
    └ <function div at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 11, in div
    return _deep("天")
           └ <function _deep at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 8, in _deep
    return 1 / val
               └ '天'
TypeError: unsupported operand type(s) for /: 'int' and 'str'



./test/test_interactive.sh


spawn python3 -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; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine
                              │                         │             └ 5
                              │                         └ 5
                              └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine
                              │                         │             └ 5
                              │                         └ 5
                              └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine

from __future__ import print_function; import better_exceptions; better_exceptions.hook(); 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; better_exceptions.hook(); a = "why hello there"; print(a); assert False
                                                                     │                         │                            └ 'why hello there'
                                                                     │                         └ 'why hello there'
                                                                     └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); 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; better_exceptions.hook(); a = "why hello there"; print(a); assert False
                                                                     │                         │                            └ 'why hello there'
                                                                     │                         └ 'why hello there'
                                                                     └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello there"; print(a); assert False
why hello there

from __future__ import print_function; import better_exceptions; better_exceptions.hook(); 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; better_exceptions.hook(); a = "why     hello          " + "   there"; print(a); assert False
                                                                     │                         │                                                 └ 'why     hello             there'
                                                                     │                         └ 'why     hello             there'
                                                                     └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); 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; better_exceptions.hook(); a = "why     hello          " + "   there"; print(a); assert False
                                                                     │                         │                                                 └ 'why     hello             there'
                                                                     │                         └ 'why     hello             there'
                                                                     └ <module 'test_module' from '/removed/for/test/purposes.py'>
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why     hello          " + "   there"; print(a); assert False
why     hello             there



python3 test/test_logging.py


ERROR:__main__:callback failed
Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 16, in foo
    cb()
    └ <function bar3 at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 33, 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 "/removed/for/test/purposes.ext", line 16, in foo
    cb()
    └ <function bar4 at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 38, in bar4
    assert baz == 90
           └ 52
AssertionError: assert baz == 90




python3 test/test_truncating.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 12, in <module>
    div()
    └ <function ...
  File "/removed/for/test/purposes.ext", line 9, in div
    return 1 / var
               └ '999999999...
TypeError: unsupported operand type(s) for /: 'int' and 'str'



python3 test/test_truncating_disabled.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 12, in <module>
    div()
    └ <function div at 0xDEADBEEF>
  File "/removed/for/test/purposes.ext", line 9, in div
    return 1 / var
               └ '999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
TypeError: unsupported operand type(s) for /: 'int' and 'str'



python3 test/test_indentation_error.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 13, in <module>
    exec(code)
         └ '\nif True:\n    a = 5\n        print("foobar")  #intentional faulty indentation here.\n    b = 7\n'
File "<string>", line 4
    print("foobar")  #intentional faulty indentation here.
IndentationError: unexpected indent



python3 test/test_syntax_error.py


Traceback (most recent call last):
  File "/removed/for/test/purposes.ext", line 12, in <module>
    exec(code)
         └ '\nif True:\n    a = 5\n    b = 7 *\n'
File "<string>", line 4
    b = 7 *
           ^
SyntaxError: invalid syntax