Skip to content

tests(logging): don't test warn #1738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/tracer/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from tests import BaseTestCase

ALL_LEVEL_NAMES = ('debug', 'info', 'warn', 'warning', 'error', 'exception', 'critical', 'fatal')
ALL_LEVEL_NAMES = ('debug', 'info', 'warning', 'error', 'exception', 'critical', 'fatal')


class DDLoggerTestCase(BaseTestCase):
Expand Down Expand Up @@ -143,8 +143,8 @@ def test_logger_log(self):
# -- NOTSET
# By default no level is set so we only get warn, error, and critical messages
self.assertEqual(log.level, logging.NOTSET)
# `log.warn`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['WARNING', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])
# `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])

# -- CRITICAL
log.setLevel(logging.CRITICAL)
Expand All @@ -158,18 +158,18 @@ def test_logger_log(self):

# -- WARN
log.setLevel(logging.WARN)
# `log.warn`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['WARNING', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])
# `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])

# -- INFO
log.setLevel(logging.INFO)
# `log.info`, `log.warn`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['INFO', 'WARNING', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])
# `log.info`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['INFO', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])

# -- DEBUG
log.setLevel(logging.DEBUG)
# `log.debug`, `log.info`, `log.warn`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['DEBUG', 'INFO', 'WARNING', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])
# `log.debug`, `log.info`, `log.warning`, `log.error`, `log.exception`, `log.critical`, `log.fatal`
self.assert_log_records(log, ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'ERROR', 'CRITICAL', 'CRITICAL'])

@mock.patch('logging.Logger.handle')
def test_logger_handle_no_limit(self, base_handle):
Expand Down