summaryrefslogtreecommitdiff
path: root/tests/unit/test_webapp.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_webapp.py
parent8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (diff)
downloadsearxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.tar.gz
searxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.zip
[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_webapp.py')
-rw-r--r--tests/unit/test_webapp.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py
index 9e8bc24ce..868645e17 100644
--- a/tests/unit/test_webapp.py
+++ b/tests/unit/test_webapp.py
@@ -1,4 +1,5 @@
-# -*- coding: utf-8 -*-
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# pylint: disable=missing-module-docstring
import json
from urllib.parse import ParseResult
@@ -11,15 +12,15 @@ from searx.preferences import Preferences
from tests import SearxTestCase
-class ViewsTestCase(SearxTestCase):
+class ViewsTestCase(SearxTestCase): # pylint: disable=missing-class-docstring, too-many-public-methods
def setUp(self):
# skip init function (no external HTTP request)
- def dummy(*args, **kwargs):
+ def dummy(*args, **kwargs): # pylint: disable=unused-argument
pass
self.setattr4test(searx.search.processors, 'initialize_processor', dummy)
- from searx import webapp # pylint disable=import-outside-toplevel
+ from searx import webapp # pylint: disable=import-outside-toplevel
webapp.app.config['TESTING'] = True # to get better error messages
self.app = webapp.app.test_client()
@@ -60,10 +61,10 @@ class ViewsTestCase(SearxTestCase):
Timing(engine='youtube', total=0.9, load=0.6),
]
- def search_mock(search_self, *args):
+ def search_mock(search_self, *args): # pylint: disable=unused-argument
search_self.result_container = Mock(
get_ordered_results=lambda: test_results,
- answers=dict(),
+ answers={},
corrections=set(),
suggestions=set(),
infoboxes=[],
@@ -87,7 +88,8 @@ class ViewsTestCase(SearxTestCase):
self.setattr4test(Preferences, 'get_value', preferences_get_value)
- self.maxDiff = None # to see full diffs
+ # to see full diffs
+ self.maxDiff = None # pylint: disable=invalid-name
def test_index_empty(self):
result = self.app.post('/')