[cpacker#319] fixed error with config with improper include in config.py
added test_log.py. for testing global logging in log.py
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from log import logger
|
||||
from memgpt.log import logger
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
|
||||
16
tests/test_log.py
Normal file
16
tests/test_log.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
from memgpt.log import logger
|
||||
from memgpt.constants import LOGGER_LOG_LEVELS
|
||||
import pytest
|
||||
|
||||
|
||||
def test_log_debug():
|
||||
# test setting logging level
|
||||
assert logging.DEBUG == LOGGER_LOG_LEVELS["DEBUG"]
|
||||
logger.setLevel(LOGGER_LOG_LEVELS["DEBUG"])
|
||||
assert logger.isEnabledFor(logging.DEBUG)
|
||||
|
||||
# Assert that the message was logged
|
||||
assert logger.hasHandlers()
|
||||
logger.debug("This is a Debug message")
|
||||
assert 1 == 1
|
||||
Reference in New Issue
Block a user