mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
19 lines
372 B
Python
19 lines
372 B
Python
import traceback
|
|
|
|
try:
|
|
a = {'123': 4}
|
|
b = a[6]
|
|
except KeyError:
|
|
actual = traceback.format_exc()
|
|
|
|
expected = '''Traceback (most recent call last):
|
|
File "tests/80_traceback.py", line 5
|
|
b = a[6]
|
|
KeyError: 6'''
|
|
|
|
if actual != expected:
|
|
print('--- ACTUAL RESULT -----')
|
|
print(actual)
|
|
print('--- EXPECTED RESULT ---')
|
|
print(expected)
|
|
exit(1) |