Files
OpenBB/tests/openbb_terminal/core/log/conftest.py
Henrique Joaquim addd4f7727 Feature/improve posthog logs (#4951)
* improving handling of logging handlers

* removing alias

* lint

* removing debug print

* adding alias back

* adding the commithash to the system so it gets logged

* doing posthog on hub_user login

* ruff

* tacking this on - docs update

* identify and alias together

* fixing conditions

* the juan way

* ruff

* don't send logs to S3 if posthog is an active handler

* branch name on the posthog logs

* removing duplicate import

* fixing tests

---------

Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-05-12 09:02:14 +00:00

34 lines
867 B
Python

import pytest
from openbb_terminal.core.log.generation.settings import (
AppSettings,
AWSSettings,
LogSettings,
Settings,
)
@pytest.fixture()
def settings(tmp_path):
settings_obj = Settings(
app_settings=AppSettings(
commit_hash="MOCK_COMMIT_HASH",
name="MOCK_NAME",
identifier="MOCK_IDENTIFIER",
session_id="MOCK_SESSION_ID",
user_id="MOCK_USER_ID",
),
aws_settings=AWSSettings(
aws_access_key_id="MOCK_AWS_ACCESS_KEY_ID",
aws_secret_access_key="MOCK_AWS_ACCESS_KEY", # pragma: allowlist secret
),
log_settings=LogSettings(
directory=tmp_path,
frequency="H",
handler_list=["file"],
rolling_clock=False,
verbosity=20,
),
)
return settings_obj