mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 00:10:03 +02:00
fixes logging test
This commit is contained in:
parent
f8cae28128
commit
0e5f1ede20
@ -1,12 +1,12 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pydase.utils.logging import setup_logging
|
|
||||||
from pytest import LogCaptureFixture
|
from pytest import LogCaptureFixture
|
||||||
|
|
||||||
|
|
||||||
def test_log_error(caplog: LogCaptureFixture):
|
def test_log_error(caplog: LogCaptureFixture):
|
||||||
setup_logging("ERROR")
|
logger = logging.getLogger("pydase")
|
||||||
logger = logging.getLogger()
|
logger.setLevel(logging.ERROR)
|
||||||
|
|
||||||
logger.debug("This is a debug message")
|
logger.debug("This is a debug message")
|
||||||
logger.info("This is an info message")
|
logger.info("This is an info message")
|
||||||
logger.warning("This is a warning message")
|
logger.warning("This is a warning message")
|
||||||
@ -21,8 +21,9 @@ def test_log_error(caplog: LogCaptureFixture):
|
|||||||
|
|
||||||
|
|
||||||
def test_log_warning(caplog: LogCaptureFixture):
|
def test_log_warning(caplog: LogCaptureFixture):
|
||||||
setup_logging("WARNING")
|
logger = logging.getLogger("pydase")
|
||||||
logger = logging.getLogger()
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
logger.debug("This is a debug message")
|
logger.debug("This is a debug message")
|
||||||
logger.info("This is an info message")
|
logger.info("This is an info message")
|
||||||
logger.warning("This is a warning message")
|
logger.warning("This is a warning message")
|
||||||
@ -37,10 +38,9 @@ def test_log_warning(caplog: LogCaptureFixture):
|
|||||||
|
|
||||||
|
|
||||||
def test_log_debug(caplog: LogCaptureFixture):
|
def test_log_debug(caplog: LogCaptureFixture):
|
||||||
setup_logging("DEBUG")
|
logger = logging.getLogger("pydase")
|
||||||
logger = (
|
logger.setLevel(logging.DEBUG)
|
||||||
logging.getLogger()
|
|
||||||
) # Get the root logger or replace with the appropriate logger.
|
|
||||||
logger.debug("This is a debug message")
|
logger.debug("This is a debug message")
|
||||||
logger.info("This is an info message")
|
logger.info("This is an info message")
|
||||||
logger.warning("This is a warning message")
|
logger.warning("This is a warning message")
|
||||||
@ -54,10 +54,9 @@ def test_log_debug(caplog: LogCaptureFixture):
|
|||||||
|
|
||||||
|
|
||||||
def test_log_info(caplog: LogCaptureFixture):
|
def test_log_info(caplog: LogCaptureFixture):
|
||||||
setup_logging("INFO")
|
logger = logging.getLogger("pydase")
|
||||||
logger = (
|
logger.setLevel(logging.INFO)
|
||||||
logging.getLogger()
|
|
||||||
) # Get the root logger or replace with the appropriate logger.
|
|
||||||
logger.debug("This is a debug message")
|
logger.debug("This is a debug message")
|
||||||
logger.info("This is an info message")
|
logger.info("This is an info message")
|
||||||
logger.warning("This is a warning message")
|
logger.warning("This is a warning message")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user