mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
Raise repo exit errors in place of sys.exit
Bug: b/293344017 Change-Id: I92d81c78eba8ff31b5252415f4c9a515a6c76411 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381774 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
This commit is contained in:
@ -21,12 +21,16 @@ import unittest
|
||||
import error
|
||||
import project
|
||||
import git_command
|
||||
import fetch
|
||||
import command
|
||||
from subcmds import all_modules
|
||||
|
||||
imports = all_modules + [
|
||||
error,
|
||||
project,
|
||||
git_command,
|
||||
fetch,
|
||||
command,
|
||||
]
|
||||
|
||||
|
||||
|
@ -204,12 +204,12 @@ class GitRequireTests(unittest.TestCase):
|
||||
|
||||
def test_older_fatal(self):
|
||||
"""Test fatal require calls with old versions."""
|
||||
with self.assertRaises(SystemExit) as e:
|
||||
with self.assertRaises(git_command.GitRequireError) as e:
|
||||
git_command.git_require((2,), fail=True)
|
||||
self.assertNotEqual(0, e.code)
|
||||
|
||||
def test_older_fatal_msg(self):
|
||||
"""Test fatal require calls with old versions and message."""
|
||||
with self.assertRaises(SystemExit) as e:
|
||||
with self.assertRaises(git_command.GitRequireError) as e:
|
||||
git_command.git_require((2,), fail=True, msg="so sad")
|
||||
self.assertNotEqual(0, e.code)
|
||||
|
Reference in New Issue
Block a user