Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration test debug mode flag #4133

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions openbb_terminal/core/completer/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ def __patch_controller_functions(controller):
),
]

if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
rich.start()
patched_function_list = []
for patcher in patcher_list:
patched_function_list.append(patcher.start())

yield patched_function_list

if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
rich.stop()
for patcher in patcher_list:
patcher.stop()
Expand Down Expand Up @@ -319,7 +319,7 @@ def build_controller_choice_map(controller) -> dict:
argument_parser=argument_parser
)
except Exception as exception:
if environ.get("DEBUG_MODE", "false") == "true":
if str(environ.get("DEBUG_MODE", "false")).lower() == "true":
raise Exception(
f"On command : `{command}`.\n{str(exception)}"
) from exception
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def wrapper(*args, **kwargs):
extra={"func_name_override": func.__name__},
)

if os.environ.get("DEBUG_MODE") == "true":
if str(os.environ.get("DEBUG_MODE")).lower() == "true":
value = func(*args, **kwargs)
log.info("END", extra={"func_name_override": func.__name__})
return value
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/portfolio/portfolio_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def read_transactions(path: str) -> pd.DataFrame:

# Load transactions from file
if path.endswith(".xlsx"):
if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
warnings.filterwarnings(
"ignore", category=UserWarning, module="openpyxl"
)
Expand Down