Merge pull request #84 from searxng/fix-test-ignore-etc-settings

[fix] unit test: don't load /etc/searx/settings.yml
This commit is contained in:
Alexandre Flament 2021-05-20 13:31:53 +02:00 committed by GitHub
commit 0c1ab0227d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,9 @@ def get_user_settings_path():
# enviroment variable SEARX_SETTINGS_PATH # enviroment variable SEARX_SETTINGS_PATH
return check_settings_yml(environ['SEARX_SETTINGS_PATH']) return check_settings_yml(environ['SEARX_SETTINGS_PATH'])
if environ.get('SEARX_DISABLE_ETC_SETTINGS', '').lower() in ('1', 'true'):
return None
# if not, get it from searx code base or last solution from /etc/searx # if not, get it from searx code base or last solution from /etc/searx
return check_settings_yml('/etc/searx/settings.yml') return check_settings_yml('/etc/searx/settings.yml')

View File

@ -1,2 +1,5 @@
import os import os
os.environ['SEARX_DEBUG'] = '1' os.environ['SEARX_DEBUG'] = '1'
os.environ['SEARX_DISABLE_ETC_SETTINGS'] = '1'
os.environ.pop('SEARX_SETTINGS_PATH', None)