Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

func_e12xx.py 660B

12345678910111213141516171819202122232425262728
  1. # pylint: disable=E1101, no-absolute-import
  2. """Test checking of log format strings
  3. """
  4. import logging
  5. __revision__ = ''
  6. def pprint():
  7. """Test string format in logging statements.
  8. """
  9. # These should all emit lint errors:
  10. logging.info(0, '') # 1205
  11. logging.info('', '') # 1205
  12. logging.info('%s%', '') # 1201
  13. logging.info('%s%s', '') # 1206
  14. logging.info('%s%y', '', '') # 1200
  15. logging.info('%s%s', '', '', '') # 1205
  16. # These should be okay:
  17. logging.info(1)
  18. logging.info(True)
  19. logging.info('')
  20. logging.info('%s%')
  21. logging.info('%s', '')
  22. logging.info('%s%%', '')
  23. logging.info('%s%s', '', '')