mirror of
https://github.com/searxng/searxng.git
synced 2025-07-23 05:09:17 +02:00
[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>
This commit is contained in:
parent
8205f170ff
commit
542f7d0d7b
118 changed files with 261 additions and 369 deletions
|
@ -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('/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue