From 8c1a65d32fb6a0859c0052d668d01f08325f11ad Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 5 May 2021 13:08:54 +0200 Subject: [mod] multithreading only in searx.search.* packages it prepares the new architecture change, everything about multithreading in moved in the searx.search.* packages previously the call to the "init" function of the engines was done in searx.engines: * the network was not set (request not sent using the defined proxy) * it requires to monkey patch the code to avoid HTTP requests during the tests --- tests/unit/test_webapp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/unit/test_webapp.py') diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index 9d83b7596..2cbdc83d6 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -5,14 +5,16 @@ from urllib.parse import ParseResult from mock import Mock from searx.testing import SearxTestCase from searx.search import Search -import searx.engines +import searx.search.processors class ViewsTestCase(SearxTestCase): def setUp(self): # skip init function (no external HTTP request) - self.setattr4test(searx.engines, 'initialize_engines', searx.engines.load_engines) + def dummy(*args, **kwargs): + pass + self.setattr4test(searx.search.processors, 'initialize_processor', dummy) from searx import webapp # pylint disable=import-outside-toplevel -- cgit v1.2.3