-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e112ba1
commit 8392d34
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2023 Valentin Goldite. All Rights Reserved. | ||
"""Tests for dict routines.""" | ||
import pytest | ||
import pytest_check as check | ||
|
||
from cliconfig._logger import create_logger | ||
|
||
|
||
def test_create_logger( | ||
caplog: pytest.CaptureFixture, | ||
capsys: pytest.CaptureFixture, | ||
) -> None: | ||
"""Test create_logger.""" | ||
logger = create_logger() | ||
logger.info("This is an info message.") | ||
check.is_true("INFO cliconfig._logger:test_logger.py:" in caplog.text) | ||
check.is_true(" This is an info message." in caplog.text) | ||
check.is_true("INFO - This is an info message." in capsys.readouterr().out) | ||
logger.warning("This is a warning message.") | ||
check.is_true("WARNING cliconfig._logger:test_logger.py:" in caplog.text) | ||
check.is_true(" This is a warning message." in caplog.text) | ||
check.is_true("WARNING - This is a warning message." in capsys.readouterr().out) |