Skip to content

fix: replace sys.exit in fatal() with raise SystemExit#123

Merged
privateip merged 1 commit intoitential:mainfrom
privateip:chore/fatal-raises-systemexit
Mar 19, 2026
Merged

fix: replace sys.exit in fatal() with raise SystemExit#123
privateip merged 1 commit intoitential:mainfrom
privateip:chore/fatal-raises-systemexit

Conversation

@privateip
Copy link
Member

  • Replace sys.exit(1) and print() with raise SystemExit(1) in fatal()
  • Change return type annotation from None to NoReturn
  • Add NoReturn import from typing
  • Remove stderr print — message is captured in the log at FATAL level
  • Update tests to assert SystemExit via pytest.raises instead of mocking sys.exit and builtins.print
  • Update docstring and module-level example to reflect new behavior

- Replace sys.exit(1) and print() with raise SystemExit(1) in fatal()
- Change return type annotation from None to NoReturn
- Add NoReturn import from typing
- Remove stderr print — message is captured in the log at FATAL level
- Update tests to assert SystemExit via pytest.raises instead of mocking sys.exit and builtins.print
- Update docstring and module-level example to reflect new behavior
@privateip privateip requested a review from a team as a code owner March 18, 2026 13:15
@privateip privateip merged commit 66d5380 into itential:main Mar 19, 2026
7 checks passed
@privateip privateip deleted the chore/fatal-raises-systemexit branch March 19, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant