mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-04 06:30:17 +00:00
add test
This commit is contained in:
parent
1c0daadb18
commit
966a4444d8
@ -203,18 +203,22 @@ assert a == [0, 1, 3, 4, 5]
|
||||
|
||||
try:
|
||||
result = 10 / 0
|
||||
exit(1)
|
||||
except (ZeroDivisionError, TypeError) as e:
|
||||
assert type(e) == ZeroDivisionError
|
||||
if type(e) != ZeroDivisionError:
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
try:
|
||||
result = 10 / 0
|
||||
exit(1)
|
||||
except (ZeroDivisionError, 1) as e:
|
||||
assert False
|
||||
exit(1)
|
||||
except (TypeError) as e:
|
||||
assert False
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
assert type(e) == TypeError
|
||||
if type(e) != TypeError:
|
||||
exit(1)
|
||||
|
||||
"""
|
||||
# finally, only
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user