mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
refactor: update env format test to check return value instead of SystemExit
This commit is contained in:
parent
054e0820b7
commit
ba14ab96da
2 changed files with 3 additions and 3 deletions
|
@ -535,6 +535,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
|||
except ValueError:
|
||||
io.tool_error(f"Invalid --set-env format: {env_setting}")
|
||||
io.tool_output("Format should be: ENV_VAR_NAME=value")
|
||||
analytics.event("exit", reason="Invalid env var format")
|
||||
return 1
|
||||
|
||||
analytics = Analytics(logfile=args.analytics_log, permanently_disable=args.analytics_disable)
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue