summaryrefslogtreecommitdiff
path: root/test/input/func_e12xx.py
blob: 83df7abc6040d1dae49d3510df748b19ddee23da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# pylint: disable=E1101
"""Test checking of log format strings
"""

__revision__ = ''

import logging

def pprint():
    """Test string format in logging statements.
    """
    # These should all emit lint errors:
    logging.info(0, '') # 1205
    logging.info('', '') # 1205
    logging.info('%s%', '') # 1201
    logging.info('%s%s', '') # 1206
    logging.info('%s%y', '', '') # 1200
    logging.info('%s%s', '', '', '') # 1205

    # These should be okay:
    logging.info(1)
    logging.info(True)
    logging.info('')
    logging.info('%s%')
    logging.info('%s', '')
    logging.info('%s%%', '')
    logging.info('%s%s', '', '')