mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 12:10:00 +00:00
[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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user