From 7875de078a6fffdde2dc5146f3f036d1a1676cb3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 10 May 2025 11:46:49 -0700 Subject: [PATCH] fix: Remove unused import/var and fix line length in test --- tests/basic/test_coder.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/basic/test_coder.py b/tests/basic/test_coder.py index c6417ad1b..2f250d858 100644 --- a/tests/basic/test_coder.py +++ b/tests/basic/test_coder.py @@ -1,4 +1,3 @@ -import locale import os import tempfile import unittest @@ -1254,10 +1253,7 @@ This command will print 'Hello, World!' to the console.""" mock_env_get.return_value = None self.assertIsNone(coder.get_user_language()) # Should be None if nothing found - # 3. Test with environment variables - env_vars_to_test = ["LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"] - - # Test LANG + # 3. Test with environment variables: LANG with patch( "locale.getlocale", side_effect=Exception("locale error") ): # Mock locale to fail @@ -1268,8 +1264,8 @@ This command will print 'Hello, World!' to the console.""" mock_env_get.assert_any_call("LANG") mock_norm.assert_called_once_with("de_DE") - # Test LANGUAGE (takes precedence over LANG if both were hypothetically checked by os.environ.get) - # but our code checks in order, so we only need to mock the first one it finds. + # Test LANGUAGE (takes precedence over LANG if both were hypothetically checked + # by os.environ.get, but our code checks in order, so we mock the first one it finds) with patch("locale.getlocale", side_effect=Exception("locale error")): with patch("os.environ.get") as mock_env_get: mock_env_get.side_effect = lambda key: "es_ES" if key == "LANGUAGE" else None