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_webutils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/unit/test_webutils.py') diff --git a/tests/unit/test_webutils.py b/tests/unit/test_webutils.py index b4395539b..c6c441dab 100644 --- a/tests/unit/test_webutils.py +++ b/tests/unit/test_webutils.py @@ -1,10 +1,12 @@ -# -*- coding: utf-8 -*- +# SPDX-License-Identifier: AGPL-3.0-or-later +# pylint: disable=missing-module-docstring + import mock from searx import webutils from tests import SearxTestCase -class TestWebUtils(SearxTestCase): +class TestWebUtils(SearxTestCase): # pylint: disable=missing-class-docstring def test_prettify_url(self): data = ( ('https://searx.me/', 'https://searx.me/'), @@ -32,6 +34,7 @@ class TestWebUtils(SearxTestCase): query = 'a test' self.assertEqual(webutils.highlight_content(content, query), 'a') + # pylint: disable=line-too-long data = ( ('" test "', 'a test string', 'a test string'), ('"a"', 'this is a test string', 'this is a test string'), @@ -67,7 +70,7 @@ class TestWebUtils(SearxTestCase): self.assertEqual(webutils.highlight_content(content, query), expected) -class TestUnicodeWriter(SearxTestCase): +class TestUnicodeWriter(SearxTestCase): # pylint: disable=missing-class-docstring def setUp(self): self.unicode_writer = webutils.CSVWriter(mock.MagicMock()) @@ -82,7 +85,7 @@ class TestUnicodeWriter(SearxTestCase): self.assertEqual(self.unicode_writer.writerow.call_count, len(rows)) -class TestNewHmac(SearxTestCase): +class TestNewHmac(SearxTestCase): # pylint: disable=missing-class-docstring def test_bytes(self): data = b'http://example.com' with self.assertRaises(AttributeError): -- cgit v1.2.3