Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Mar 5, 2024
1 parent 86a8842 commit 0742860
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/framework/project/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import yaml

from kedro.framework.project import LOGGING, configure_logging, configure_project
from kedro.logging import fmt_rich, has_rich_handler


@pytest.fixture
Expand Down Expand Up @@ -144,3 +145,17 @@ def test_rich_traceback_disabled_on_databricks(

rich_traceback_install.assert_not_called()
rich_pretty_install.assert_called()


def test_rich_format():
assert (
fmt_rich("Hello World!", "dark_orange")
== "[dark_orange]Hello World![/dark_orange]"
)


def test_has_rich_handler():
test_logger = logging.getLogger("test_logger")
assert not has_rich_handler(test_logger)
test_logger.addHandler(RichHandler())
assert has_rich_handler(test_logger)

0 comments on commit 0742860

Please sign in to comment.