better-exceptions/test/output/python3-xterm-ascii-color.out

274 lines
11 KiB
Plaintext
Raw Normal View History

2017-03-24 08:10:14 +03:00
python3 test/test.py
Traceback (most recent call last):
File "test/test.py", line 17, in <module>
2020-12-23 04:20:19 +03:00
shallow(bar, 15)
2017-03-24 08:10:14 +03:00
| -> 2
-> <function shallow at 0xDEADBEEF>
File "test/test.py", line 8, in shallow
2017-03-24 08:10:14 +03:00
deep(a + b)
| | -> 15
| -> 2
-> <function deep at 0xDEADBEEF>
File "test/test.py", line 13, in deep
2020-12-23 04:20:19 +03:00
assert val > 10 and foo == 60
2017-03-24 08:10:14 +03:00
 | -> 52
 -> 17
2020-12-23 04:20:19 +03:00
AssertionError: assert val > 10 and foo == 60
2017-03-24 08:10:14 +03:00
python3 test/test_color.py
True
python3 test/test_encoding.py
Traceback (most recent call last):
File "test/test_encoding.py", line 14, in <module>
div()
-> <function div at 0xDEADBEEF>
File "test/test_encoding.py", line 11, in div
2020-12-23 04:20:19 +03:00
return _deep("天")
 -> <function _deep at 0xDEADBEEF>
File "test/test_encoding.py", line 8, in _deep
2020-12-23 04:20:19 +03:00
return 1 / val
 -> '天'
TypeError: unsupported operand type(s) for /: 'int' and 'str'
2017-03-24 08:10:14 +03:00
./test/test_interactive.sh
2020-12-23 04:20:19 +03:00
spawn python -m better_exceptions -q
2017-03-24 08:10:14 +03:00
>>> import better_exceptions
>>> def foo(a):
... assert a > 10
...
>>> foo(1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
2020-12-23 04:20:19 +03:00
foo(1)
2017-03-24 08:10:14 +03:00
-> <function foo at 0xDEADBEEF>
File "<console>", line 2, in foo
2020-12-23 04:20:19 +03:00
assert a > 10
2017-03-24 08:10:14 +03:00
 -> 1
2020-12-23 04:20:19 +03:00
AssertionError: assert a > 10
2017-03-24 08:10:14 +03:00
>>> exit()
./test/test_string.sh
2017-03-24 10:37:58 +03:00
import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine
2017-03-24 10:37:58 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine
2017-03-24 10:37:58 +03:00
2017-03-24 08:10:14 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: import better_exceptions; better_exceptions.hook(); a = 5; assert a > 10 # this should work fine
2017-03-24 08:10:14 +03:00
from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello there"; print(a); assert False
2017-03-24 10:37:58 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello there"; print(a); assert 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>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello there"; print(a); assert 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; better_exceptions.hook(); a = "why hello " + " there"; print(a); assert False
2017-03-24 10:47:01 +03:00
Traceback (most recent call last):
File "<string>", line 1, in <module>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello " + " there"; print(a); assert False
2017-03-24 10:47:01 +03:00
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>
2020-12-23 04:20:19 +03:00
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'>
2020-12-23 04:20:19 +03:00
AssertionError: from __future__ import print_function; import better_exceptions; better_exceptions.hook(); a = "why hello " + " there"; print(a); assert 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 16, in foo
2017-03-29 00:13:27 +03:00
cb()
-> <function bar3 at 0xDEADBEEF>
File "test/test_logging.py", line 33, in bar3
2020-12-23 04:20:19 +03:00
raise Exception('this is a test exception')
2017-03-29 00:13:27 +03:00
Exception: this is a test exception
ERROR:__main__:callback failed
Traceback (most recent call last):
File "test/test_logging.py", line 16, in foo
2017-03-29 00:13:27 +03:00
cb()
-> <function bar4 at 0xDEADBEEF>
File "test/test_logging.py", line 38, in bar4
2020-12-23 04:20:19 +03:00
assert baz == 90
2017-03-29 00:13:27 +03:00
 -> 52
2020-12-23 04:20:19 +03:00
AssertionError: assert baz == 90
2017-03-29 00:13:27 +03:00
2017-03-24 10:37:58 +03:00
2017-03-24 08:10:14 +03:00
python3 test/test_truncating.py
Traceback (most recent call last):
File "test/test_truncating.py", line 12, in <module>
div()
-> <function ...
File "test/test_truncating.py", line 9, in div
2020-12-23 04:20:19 +03:00
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 "test/test_truncating_disabled.py", line 12, in <module>
div()
-> <function div at 0xDEADBEEF>
File "test/test_truncating_disabled.py", line 9, in div
2020-12-23 04:20:19 +03:00
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 "test/test_indentation_error.py", 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 "test/test_syntax_error.py", line 12, in <module>
exec(code)
 -> '\nif True:\n a = 5\n b = 7 *\n'
File "<string>", line 4
b = 7 *
^
SyntaxError: invalid syntax
2019-09-28 18:41:45 +03:00
python3 test/test_unittest_patch.py
return a + b
TypeError: unsupported operand type(s) for +: 'int' and 'str'
2020-12-23 04:20:19 +03:00
self._callTestMethod(testMethod)
| -> <bound method MyTestCase.test_add of <__main__.MyTestCase testMethod=test_add>>
-> <__main__.MyTestCase testMethod=test_add>
File "/removed/for/test/purposes.ext", line 633, in _callTestMethod
method()
2019-09-28 18:41:45 +03:00
-> <bound method MyTestCase.test_add of <__main__.MyTestCase testMethod=test_add>>
File "test/test_unittest_patch.py", line 15, in test_add
2020-12-23 04:20:19 +03:00
self.assertEqual(add(1, "2"), 3)
2019-09-28 18:41:45 +03:00
| -> <function add at 0xDEADBEEF>
-> <__main__.MyTestCase testMethod=test_add>
File "test/test_unittest_patch.py", line 10, in add
return a + b
 | -> '2'
 -> 1
TypeError: unsupported operand type(s) for +: 'int' and 'str'
python3 test/test_chaining.py
Traceback (most recent call last):
File "test/test_chaining.py", line 11, in cause
div(x, y)
| | -> 0
| -> 1
-> <function div at 0xDEADBEEF>
File "test/test_chaining.py", line 7, in div
x / y
| -> 0
-> 1
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test/test_chaining.py", line 17, in context
cause(x, y)
| | -> 0
| -> 1
-> <function cause at 0xDEADBEEF>
File "test/test_chaining.py", line 13, in cause
2020-12-23 04:20:19 +03:00
raise ValueError("Division error")
ValueError: Division error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test/test_chaining.py", line 21, in <module>
2020-12-23 04:20:19 +03:00
context(1, 0)
-> <function context at 0xDEADBEEF>
File "test/test_chaining.py", line 19, in context
2020-12-23 04:20:19 +03:00
raise ValueError("Cause error") from e
ValueError: Cause error