aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_base.py
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-10-15 09:20:20 +0000
committerGravatar GitHub <[email protected]>2021-10-15 09:21:08 +0000
commit5408b78bdf61e6109aaad940757497cae02eaab6 (patch)
tree3f55f0dca6f878973b355492047ad458d95abbe1 /tests/test_base.py
parentActions: do not check licenses of dev packages (diff)
parentMerge pull request #1874 from python-discord/fix-bot-1869 (diff)
Merge remote-tracking branch 'origin/main' into experiments/isort
Diffstat (limited to 'tests/test_base.py')
-rw-r--r--tests/test_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_base.py b/tests/test_base.py
index 7dd5dfac4..365805a71 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -1,7 +1,7 @@
import logging
-import unittest
import unittest.mock
+from bot.log import get_logger
from tests.base import LoggingTestsMixin, _CaptureLogHandler
@@ -14,7 +14,7 @@ class LoggingTestCaseTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
- cls.log = logging.getLogger(__name__)
+ cls.log = get_logger(__name__)
def test_assert_not_logs_does_not_raise_with_no_logs(self):
"""Test if LoggingTestCase.assertNotLogs does not raise when no logs were emitted."""
@@ -55,15 +55,15 @@ class LoggingTestCaseTests(unittest.TestCase):
def test_logging_test_case_works_with_logger_instance(self):
"""Test if the LoggingTestCase captures logging for provided logger."""
- log = logging.getLogger("new_logger")
+ log = get_logger("new_logger")
with self.assertRaises(AssertionError):
with LoggingTestCase.assertNotLogs(self, logger=log):
log.info("Hello, this should raise an AssertionError")
def test_logging_test_case_respects_alternative_logger(self):
"""Test if LoggingTestCase only checks the provided logger."""
- log_one = logging.getLogger("log one")
- log_two = logging.getLogger("log two")
+ log_one = get_logger("log one")
+ log_two = get_logger("log two")
with LoggingTestCase.assertNotLogs(self, logger=log_one):
log_two.info("Hello, this should not raise an AssertionError")