IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

assert_aborts

Asserts that code aborts the process, without losing the rest of the test suite.

A hard abort (e.g. a failed debug_assert) kills the whole process, so it can't be caught with try/except. This runs the code under test in a re-exec'd child and checks that the child crashed with the expected message.