Skip to content

Commit

Permalink
Fix warning expected on logger class created from renamed import
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed May 29, 2021
1 parent 9d44b79 commit 0579186
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ modules are added.
* ``invalid-length-returned``, now also works when nothing at all is returned
following an upgrade in astroid.

* ``logging-format-interpolation`` and ``logging-not-lazy``, now works on logger
class created from renamed logging import following an upgrade in astroid.


What's New in Pylint 2.8.2?
===========================
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/l/logging_format_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class Logger(renamed_logging.Logger):
pass

custom_logger = Logger('three')
custom_logger.info('testing {0}'.format('info'))
custom_logger.info('testing %s' % 'info')
custom_logger.info('testing {0}'.format('info')) # [logging-format-interpolation]
custom_logger.info('testing %s' % 'info') # [logging-not-lazy]
2 changes: 2 additions & 0 deletions tests/functional/l/logging_format_interpolation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ logging-format-interpolation:17:43::Use lazy % formatting in logging functions
logging-format-interpolation:18:22::Use lazy % formatting in logging functions
logging-format-interpolation:19:43::Use lazy % formatting in logging functions
logging-format-interpolation:20:21::Use lazy % formatting in logging functions
logging-format-interpolation:36:19::Use lazy % formatting in logging functions
logging-not-lazy:37:0::Use lazy % formatting in logging functions

0 comments on commit 0579186

Please sign in to comment.