From 542f7d0d7bd1a12e1884ba4a1508b40e2514d472 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 11 Mar 2024 14:06:26 +0100 Subject: [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 --- tests/unit/test_external_bangs.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/unit/test_external_bangs.py') diff --git a/tests/unit/test_external_bangs.py b/tests/unit/test_external_bangs.py index 794edf159..ad20d52f7 100644 --- a/tests/unit/test_external_bangs.py +++ b/tests/unit/test_external_bangs.py @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +# pylint: disable=missing-module-docstring + from searx.external_bang import ( get_node, resolve_bang_definition, @@ -31,9 +34,9 @@ TEST_DB = { } -class TestGetNode(SearxTestCase): +class TestGetNode(SearxTestCase): # pylint: disable=missing-class-docstring - DB = { + DB = { # pylint:disable=invalid-name 'trie': { 'exam': { 'ple': 'test', @@ -62,7 +65,7 @@ class TestGetNode(SearxTestCase): self.assertEqual(after, 's') -class TestResolveBangDefinition(SearxTestCase): +class TestResolveBangDefinition(SearxTestCase): # pylint:disable=missing-class-docstring def test_https(self): url, rank = resolve_bang_definition('//example.com/' + chr(2) + chr(1) + '42', 'query') self.assertEqual(url, 'https://example.com/query') @@ -74,7 +77,7 @@ class TestResolveBangDefinition(SearxTestCase): self.assertEqual(rank, 0) -class TestGetBangDefinitionAndAutocomplete(SearxTestCase): +class TestGetBangDefinitionAndAutocomplete(SearxTestCase): # pylint:disable=missing-class-docstring def test_found(self): bang_definition, new_autocomplete = get_bang_definition_and_autocomplete('exam', external_bangs_db=TEST_DB) self.assertEqual(bang_definition, TEST_DB['trie']['exam'][LEAF_KEY]) @@ -106,7 +109,7 @@ class TestGetBangDefinitionAndAutocomplete(SearxTestCase): self.assertEqual(new_autocomplete, []) -class TestExternalBangJson(SearxTestCase): +class TestExternalBangJson(SearxTestCase): # pylint:disable=missing-class-docstring def test_no_external_bang_query(self): result = get_bang_url(SearchQuery('test', engineref_list=[EngineRef('wikipedia', 'general')])) self.assertEqual(result, None) -- cgit v1.2.3