Files
OpenBB/tests/openbb_terminal/test_debug_mode.py
Henrique Joaquim 13a91af400 Remove references to environment variables (#4633)
* 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>
2023-04-03 16:22:41 +00:00

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()