circuitpython/tests/basics/exceptpoly.py
Damien George ab69ed7dac tests: Split large tests into smaller files, to run with a small heap.
All tests in basics/ directory can now run and pass using 64-bit unix
port with only a 16k heap (./run-tests --heapsize 16k).  Tests in this
directory should remain small so they can be used for ports with a
small heap.
2016-03-15 13:07:41 +00:00

100 lines
1.7 KiB
Python

try:
raise ArithmeticError
except Exception:
print("Caught ArithmeticError via Exception")
try:
raise ArithmeticError
except ArithmeticError:
print("Caught ArithmeticError")
try:
raise AssertionError
except Exception:
print("Caught AssertionError via Exception")
try:
raise AssertionError
except AssertionError:
print("Caught AssertionError")
try:
raise AttributeError
except Exception:
print("Caught AttributeError via Exception")
try:
raise AttributeError
except AttributeError:
print("Caught AttributeError")
try:
raise EOFError
except Exception:
print("Caught EOFError via Exception")
try:
raise EOFError
except EOFError:
print("Caught EOFError")
try:
raise Exception
except BaseException:
print("Caught Exception via BaseException")
try:
raise Exception
except Exception:
print("Caught Exception")
try:
raise ImportError
except Exception:
print("Caught ImportError via Exception")
try:
raise ImportError
except ImportError:
print("Caught ImportError")
try:
raise IndentationError
except SyntaxError:
print("Caught IndentationError via SyntaxError")
try:
raise IndentationError
except IndentationError:
print("Caught IndentationError")
try:
raise IndexError
except LookupError:
print("Caught IndexError via LookupError")
try:
raise IndexError
except IndexError:
print("Caught IndexError")
try:
raise KeyError
except LookupError:
print("Caught KeyError via LookupError")
try:
raise KeyError
except KeyError:
print("Caught KeyError")
try:
raise LookupError
except Exception:
print("Caught LookupError via Exception")
try:
raise LookupError
except LookupError:
print("Caught LookupError")