summaryrefslogtreecommitdiff
path: root/tests/unit/test_engines_init.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-03-11 14:06:26 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-03-11 14:55:38 +0100
commit542f7d0d7bd1a12e1884ba4a1508b40e2514d472 (patch)
tree5256282b267e494200d02914593457854567fec4 /tests/unit/test_engines_init.py
parent8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (diff)
[mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION
In the past, some files were tested with the standard profile, others with a profile in which most of the messages were switched off ... some files were not checked at all. - ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished - the distinction ``# lint: pylint`` is no longer necessary - the pylint tasks have been reduced from three to two 1. ./searx/engines -> lint engines with additional builtins 2. ./searx ./searxng_extra ./tests -> lint all other python files Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'tests/unit/test_engines_init.py')
-rw-r--r--tests/unit/test_engines_init.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/unit/test_engines_init.py b/tests/unit/test_engines_init.py
index 2844569d1..4872a1b1b 100644
--- a/tests/unit/test_engines_init.py
+++ b/tests/unit/test_engines_init.py
@@ -1,8 +1,11 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# pylint: disable=missing-module-docstring
+
from searx import settings, engines
from tests import SearxTestCase
-class TestEnginesInit(SearxTestCase):
+class TestEnginesInit(SearxTestCase): # pylint: disable=missing-class-docstring
@classmethod
def tearDownClass(cls):
settings['outgoing']['using_tor_proxy'] = False
@@ -19,7 +22,7 @@ class TestEnginesInit(SearxTestCase):
self.assertIn('engine1', engines.engines)
self.assertIn('engine2', engines.engines)
- def test_initialize_engines_exclude_onions(self):
+ def test_initialize_engines_exclude_onions(self): # pylint: disable=invalid-name
settings['outgoing']['using_tor_proxy'] = False
engine_list = [
{'engine': 'dummy', 'name': 'engine1', 'shortcut': 'e1', 'categories': 'general'},
@@ -31,7 +34,7 @@ class TestEnginesInit(SearxTestCase):
self.assertIn('engine1', engines.engines)
self.assertNotIn('onions', engines.categories)
- def test_initialize_engines_include_onions(self):
+ def test_initialize_engines_include_onions(self): # pylint: disable=invalid-name
settings['outgoing']['using_tor_proxy'] = True
settings['outgoing']['extra_proxy_timeout'] = 100.0
engine_list = [
@@ -59,7 +62,7 @@ class TestEnginesInit(SearxTestCase):
engine_list = [
{'engine': 'dummy', 'shortcut': 'e1', 'categories': 'general'},
]
- with self.assertLogs('searx.engines', level='ERROR') as cm:
+ with self.assertLogs('searx.engines', level='ERROR') as cm: # pylint: disable=invalid-name
engines.load_engines(engine_list)
self.assertEqual(len(engines.engines), 0)
self.assertEqual(cm.output, ['ERROR:searx.engines:An engine does not have a "name" field'])
@@ -69,7 +72,7 @@ class TestEnginesInit(SearxTestCase):
engine_list = [
{'name': 'engine2', 'shortcut': 'e2', 'categories': 'onions'},
]
- with self.assertLogs('searx.engines', level='ERROR') as cm:
+ with self.assertLogs('searx.engines', level='ERROR') as cm: # pylint: disable=invalid-name
engines.load_engines(engine_list)
self.assertEqual(len(engines.engines), 0)
self.assertEqual(