Depending on the order the unit tests are executed, the searx.search module is
initalized or not, issue reported in [1]::
Traceback (most recent call last):
File "searxng/tests/unit/test_results.py", line 72, in test_result_merge_by_title
self.container.extend('stract', [fake_result(engine='stract', title='short title')])
File "searxng/searx/results.py", line 243, in extend
histogram_observe(standard_result_count, 'engine', engine_name, 'result', 'count')
File "searxng/searx/metrics/__init__.py", line 49, in histogram_observe
histogram_storage.get(*args).observe(duration)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
To ensure that the searx.search module is initialized, the
- searx.engines.load_engines is replace by
- searx.search.initialize
[1] https://github.com/searxng/searxng/pull/3932#discussion_r1822406569
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
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>
Disable the python code formatting from python-black, where the readability of
code suffers by formatting.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>