diff options
author | Alexandre Flament <alex@al-f.net> | 2021-10-02 12:21:02 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-10-02 16:54:11 +0200 |
commit | 430babca253369d82e864500118f914a9420f74b (patch) | |
tree | bed242205b23585a485911a344dd478dce6a6f76 /tests | |
parent | e39a03cc61e9792afb34084fb4d9973a61deecea (diff) | |
download | searxng-430babca253369d82e864500118f914a9420f74b.tar.gz searxng-430babca253369d82e864500118f914a9420f74b.zip |
SearXNG: environment variables
Diffstat (limited to 'tests')
-rw-r--r-- | tests/__init__.py | 12 | ||||
-rw-r--r-- | tests/robot/__main__.py | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 23e62f040..c823cec87 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,11 +2,17 @@ import os import aiounittest -os.environ['SEARX_DEBUG'] = '1' -os.environ['SEARX_DEBUG_LOG_LEVEL'] = 'WARNING' -os.environ['SEARX_DISABLE_ETC_SETTINGS'] = '1' +os.environ.pop('SEARX_DEBUG', None) +os.environ.pop('SEARX_DEBUG_LOG_LEVEL', None) +os.environ.pop('SEARX_DISABLE_ETC_SETTINGS', None) os.environ.pop('SEARX_SETTINGS_PATH', None) +os.environ.pop('SEARXNG_SETTINGS_PATH', None) + +os.environ['SEARXNG_DEBUG'] = '1' +os.environ['SEARXNG_DEBUG_LOG_LEVEL'] = 'WARNING' +os.environ['SEARXNG_DISABLE_ETC_SETTINGS'] = '1' + class SearxTestLayer: """Base layer for non-robot tests.""" diff --git a/tests/robot/__main__.py b/tests/robot/__main__.py index e435f512a..d4d6642a9 100644 --- a/tests/robot/__main__.py +++ b/tests/robot/__main__.py @@ -35,10 +35,10 @@ class SearxRobotLayer(): # - debug mode: https://flask.palletsprojects.com/quickstart/#debug-mode # - Flask.run(..): https://flask.palletsprojects.com/api/#flask.Flask.run - os.environ['SEARX_DEBUG'] = '0' + os.environ['SEARXNG_DEBUG'] = '0' # set robot settings path - os.environ['SEARX_SETTINGS_PATH'] = str(tests_path / 'robot' / 'settings_robot.yml') + os.environ['SEARXNG_SETTINGS_PATH'] = str(tests_path / 'robot' / 'settings_robot.yml') # run the server self.server = subprocess.Popen( # pylint: disable=consider-using-with @@ -52,7 +52,7 @@ class SearxRobotLayer(): def tearDown(self): os.kill(self.server.pid, 9) # remove previously set environment variable - del os.environ['SEARX_SETTINGS_PATH'] + del os.environ['SEARXNG_SETTINGS_PATH'] def run_robot_tests(tests): |