Files
micropython/tests/basics/exception_chain.py
Damien George 7db50ccf5f tests/basics: Skip exception_chain and self_type_check on unix minimal.
These two tests can't run on the unix minimal build because it doesn't have
the relevant build options enabled.  So skip them.

Signed-off-by: Damien George <damien@micropython.org>
2025-10-02 00:37:29 +10:00

23 lines
557 B
Python

# Exception chaining is not supported, but check that basic
# exception works as expected.
import sys
# The unix minimal build doesn't enable MICROPY_WARNINGS (required for this test).
if getattr(sys.implementation, "_build", None) == "minimal":
print("SKIP")
raise SystemExit
try:
raise Exception from None
except Exception:
print("Caught Exception")
try:
try:
raise ValueError("Value")
except Exception as exc:
raise RuntimeError("Runtime") from exc
except Exception as ex2:
print("Caught Exception:", ex2)