2017-03-24 08:10:14 +03:00
python3 test/test.py
Traceback (most recent call last):
File "test/test.py", line 16, in <module>
shallow(bar, [31m15 [m)
[36m| -> 2 [m
[36m-> <function shallow at 0xDEADBEEF> [m
File "test/test.py", line 7, in shallow
deep(a + b)
[36m| | -> 15 [m
[36m| -> 2 [m
[36m-> <function deep at 0xDEADBEEF> [m
File "test/test.py", line 12, in deep
[33;1massert [m val > [31m10 [m and foo == [31m60 [m
[36m | -> 52 [m
[36m -> 17 [m
AssertionError: [33;1massert [m val > [31m10 [m and foo == [31m60 [m
python3 test/test_color.py
True
2017-04-25 01:48:26 +03:00
python3 test/test_encoding.py
Traceback (most recent call last):
File "test/test_encoding.py", line 13, in <module>
div()
[36m-> <function div at 0xDEADBEEF> [m
File "test/test_encoding.py", line 10, in div
[33;1mreturn [m _deep( [31m'天' [m)
[36m -> <function _deep at 0xDEADBEEF> [m
File "test/test_encoding.py", line 7, in _deep
[33;1mreturn [m [31m1 [m / val
[36m -> '天' [m
TypeError: unsupported operand type(s) for /: 'int' and 'str'
2017-03-24 08:10:14 +03:00
./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( [31m1 [m)
[36m-> <function foo at 0xDEADBEEF> [m
File "<console>", line 2, in foo
[33;1massert [m a > [31m10 [m
[36m -> 1 [m
AssertionError: [33;1massert [m a > [31m10 [m
>>> exit()
./test/test_string.sh
2017-03-24 10:37:58 +03:00
import better_exceptions; a = 5; assert a > 10 # this should work fine
Traceback (most recent call last):
File "<string>", line 1, in <module>
[33;1mimport [m better_exceptions; a = [31m5 [m; [33;1massert [m a > [31m10 [m [2;37m# this should work fine [m
[36m | -> 5 [m
[36m -> 5 [m
AssertionError: [33;1mimport [m better_exceptions; a = [31m5 [m; [33;1massert [m a > [31m10 [m [2;37m# this should work fine [m
2017-03-24 08:10:14 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2017-03-24 09:58:27 +03:00
[33;1mimport [m better_exceptions; a = [31m5 [m; [33;1massert [m a > [31m10 [m [2;37m# this should work fine [m
[36m | -> 5 [m
[36m -> 5 [m
AssertionError: [33;1mimport [m better_exceptions; a = [31m5 [m; [33;1massert [m a > [31m10 [m [2;37m# this should work fine [m
2017-03-24 08:10:14 +03:00
2017-03-24 10:37:58 +03:00
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>
2017-03-24 10:47:01 +03:00
from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello there' [m; [35;1mprint [m(a); [33;1massert [m False
[36m | -> 'why hello there' [m
2017-03-24 10:37:58 +03:00
[36m -> 'why hello there' [m
2017-03-24 10:47:01 +03:00
AssertionError: from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello there' [m; [35;1mprint [m(a); [33;1massert [m False
2017-03-24 10:37:58 +03:00
why hello there
2017-03-29 00:13:27 +03:00
2017-03-24 10:37:58 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2017-03-24 10:47:01 +03:00
from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello there' [m; [35;1mprint [m(a); [33;1massert [m False
[36m | -> 'why hello there' [m
2017-03-24 10:37:58 +03:00
[36m -> 'why hello there' [m
2017-03-24 10:47:01 +03:00
AssertionError: from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello there' [m; [35;1mprint [m(a); [33;1massert [m False
2017-03-29 00:13:27 +03:00
why hello there
2017-03-24 10:47:01 +03:00
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; [33;1mimport [m better_exceptions; a = [31m'why hello ' [m + [31m' there' [m; [35;1mprint [m(a); [33;1massert [m False
[36m | -> 'why hello there' [m
[36m -> 'why hello there' [m
AssertionError: from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello ' [m + [31m' there' [m; [35;1mprint [m(a); [33;1massert [m False
why hello there
2017-03-29 00:13:27 +03:00
2017-03-24 10:47:01 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello ' [m + [31m' there' [m; [35;1mprint [m(a); [33;1massert [m False
[36m | -> 'why hello there' [m
[36m -> 'why hello there' [m
AssertionError: from __future__ import print_function; [33;1mimport [m better_exceptions; a = [31m'why hello ' [m + [31m' there' [m; [35;1mprint [m(a); [33;1massert [m False
2017-03-29 00:13:27 +03:00
why hello there
python3 test/test_logging.py
ERROR:__main__:callback failed
Traceback (most recent call last):
File "test/test_logging.py", line 15, in foo
cb()
[36m-> <function bar3 at 0xDEADBEEF> [m
File "test/test_logging.py", line 32, in bar3
[33;1mraise [m [35;1mException [m( [31m'this is a test exception' [m)
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()
[36m-> <function bar4 at 0xDEADBEEF> [m
File "test/test_logging.py", line 37, in bar4
[33;1massert [m baz == [31m90 [m
[36m -> 52 [m
AssertionError: [33;1massert [m baz == [31m90 [m
2017-03-24 10:37:58 +03:00
2017-03-24 08:10:14 +03:00