refactor: update env format test to check return value instead of SystemExit

This commit is contained in:
Paul Gauthier (aider) 2024-12-07 08:09:56 -08:00
parent 054e0820b7
commit ba14ab96da
2 changed files with 3 additions and 3 deletions

View file

@ -703,9 +703,8 @@ class TestMain(TestCase):
def test_set_env_invalid_format(self):
# Test invalid format handling
with GitTemporaryDirectory():
with self.assertRaises(SystemExit) as cm:
main(["--set-env", "INVALID_FORMAT", "--exit", "--yes"])
self.assertEqual(cm.exception.code, 1)
result = main(["--set-env", "INVALID_FORMAT", "--exit", "--yes"])
self.assertEqual(result, 1)
def test_invalid_edit_format(self):
with GitTemporaryDirectory():