mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-06-02 16:02:08 +08:00
* removing references to test_mode as env variable * removing references to os.getenv * adding functions to change system properties * removing references to env * introducing set_system_variable and removing change_logging_suppress function * removing change_test_mode and change_debug_mode * removing change_log_collect * adjusting config_terminal and generate_sdk * generating the sdk * removing unused imoports * introducing DISABLE_STREAMLIT_WARNING * removing load_env_vars * test_print_help test * sync tests * rewrite tests * setting the auth to True as default --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
25 lines
518 B
Python
25 lines
518 B
Python
import logging
|
|
|
|
import pytest
|
|
|
|
from openbb_terminal.core.session.current_system import set_system_variable
|
|
from openbb_terminal.decorators import log_start_end
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
@log_start_end(log=logger)
|
|
def function_that_fails():
|
|
raise ValueError("Failure")
|
|
|
|
|
|
def test_debug_false():
|
|
set_system_variable("DEBUG_MODE", False)
|
|
function_that_fails()
|
|
|
|
|
|
def test_debug_true():
|
|
set_system_variable("DEBUG_MODE", True)
|
|
with pytest.raises(ValueError):
|
|
function_that_fails()
|