diff options
author | Jason Chang <jasonnc@google.com> | 2023-08-03 14:38:00 -0700 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-08-07 23:56:07 +0000 |
commit | f9aacd4087b02948da9a7878da48ea186ab99d5a (patch) | |
tree | b683190635cd6fcb7cf817837ad0c4259b53078f /tests/test_git_command.py | |
parent | b8a7b4a629c3435d77a3266a4e6dce51dc342bd9 (diff) | |
download | git-repo-f9aacd4087b02948da9a7878da48ea186ab99d5a.tar.gz |
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>
Diffstat (limited to 'tests/test_git_command.py')
-rw-r--r-- | tests/test_git_command.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_git_command.py b/tests/test_git_command.py index 1e8beabc..3dd31b29 100644 --- a/tests/test_git_command.py +++ b/tests/test_git_command.py | |||
@@ -204,12 +204,12 @@ class GitRequireTests(unittest.TestCase): | |||
204 | 204 | ||
205 | def test_older_fatal(self): | 205 | def test_older_fatal(self): |
206 | """Test fatal require calls with old versions.""" | 206 | """Test fatal require calls with old versions.""" |
207 | with self.assertRaises(SystemExit) as e: | 207 | with self.assertRaises(git_command.GitRequireError) as e: |
208 | git_command.git_require((2,), fail=True) | 208 | git_command.git_require((2,), fail=True) |
209 | self.assertNotEqual(0, e.code) | 209 | self.assertNotEqual(0, e.code) |
210 | 210 | ||
211 | def test_older_fatal_msg(self): | 211 | def test_older_fatal_msg(self): |
212 | """Test fatal require calls with old versions and message.""" | 212 | """Test fatal require calls with old versions and message.""" |
213 | with self.assertRaises(SystemExit) as e: | 213 | with self.assertRaises(git_command.GitRequireError) as e: |
214 | git_command.git_require((2,), fail=True, msg="so sad") | 214 | git_command.git_require((2,), fail=True, msg="so sad") |
215 | self.assertNotEqual(0, e.code) | 215 | self.assertNotEqual(0, e.code) |