Skip to content

Commit bf2985a

Browse files
Move func_bug113231 to new functional tests
1 parent 08b67ff commit bf2985a

File tree

4 files changed

+23
-25
lines changed

4 files changed

+23
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# pylint: disable=missing-docstring, too-few-public-methods, no-member
2+
3+
from __future__ import absolute_import
4+
# Muck up the names in an effort to confuse...
5+
import logging as renamed_logging
6+
7+
8+
class Logger:
9+
"""Fake logger"""
10+
11+
12+
logger = renamed_logging.getLogger(__name__)
13+
fake_logger = Logger()
14+
15+
# Statements that should be flagged
16+
renamed_logging.warning('%s, %s' % (4, 5)) # [logging-not-lazy]
17+
logger.warning('%s' % 5) # [logging-not-lazy]
18+
19+
# Statements that should not be flagged:
20+
fake_logger.warn('%s' % 5)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
logging-not-lazy:16::Use lazy % formatting in logging functions
2+
logging-not-lazy:17::Use lazy % formatting in logging functions

tests/input/func_bug113231.py

-24
This file was deleted.

tests/test_func.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def gen_tests(filter_rgx):
125125
tests.append((module_file, messages_file, dependencies))
126126
if UPDATE_FILE.exists():
127127
return tests
128-
assert len(tests) < 55, "Please do not add new test cases here."
128+
assert len(tests) < 54, "Please do not add new test cases here."
129129
return tests
130130

131131

0 commit comments

Comments
 (0)