Files
wehub-resource-sync e9a2f726c9
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.13) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:29:51 +08:00

18 lines
536 B
Python

# SPDX-License-Identifier: Apache-2.0
"""Tests for fatal process-exit helpers."""
from unittest.mock import patch
from omlx.utils.fatal import FATAL_EXIT_CODE, fatal_exit
def test_fatal_exit_dumps_traceback_and_exits():
with (
patch("omlx.utils.fatal.faulthandler.dump_traceback") as dump_traceback,
patch("omlx.utils.fatal.os._exit") as exit_process,
):
fatal_exit("fatal test")
dump_traceback.assert_called_once_with(all_threads=True)
exit_process.assert_called_once_with(FATAL_EXIT_CODE)